Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: hasFormat in RangeSelection is not consistent with dispatchCommand #6935

Open
tihorygit opened this issue Dec 10, 2024 · 0 comments
Open

Comments

@tihorygit
Copy link

When set a text style on part of text and selection goes over, hasFormat return false but dispatchCommand remove format of text.
Ex: in playground write two word like "Bug Demo" and select "Bug" and press Bold button, now select "Bug Demo" you will see Bold button shows text is not bold so you expected when click on it all select text will become bold but Bold button removes bold style of all text.

Lexical version: Playground version

Steps To Reproduce

  1. Write "Bug Demo" in playground
  2. Make "Bug" bold
  3. Select "Bug Demo"
  4. Press Bold button

Link to code example: https://playground.lexical.dev/#doc=H4sIAAAAAAAAA52QQWvDMAyF_8rQ2RSn3botx1J6HuQ4ehCxlhocKyhKWSj577PTjq5jjLGT_R7S9ySdgJxXlkpRCcoTCLPmtz744IQilK_fhCNFH6C0Bt5YWkzlhYGWXeqHmJ0ABnodQzbSV-k91cBmaLIYu2zPnoEjSe85cYvJ_Ei2fyHfbanl39h7A84L1TprCCpwjcggHx3Fc9wF0qFgI9gdbkjnyN117Syrz4H-kzPf-2bYyUDAXis8kkv6cbV6Wj6sn--tXafleZA6970EHBvhIbqv3WAXy2JhYfoAl-I3i9gBAAA

The current behavior

Bold button shows text is not bold but when click on it, it removes style of bold texts.

The expected behavior

Bold button shows text is bold
Or click on Bold button add bold format to all selected text

@tihorygit tihorygit changed the title Bug: hasFormat in RangeSelection does not consistent with dispatchCommand Bug: hasFormat in RangeSelection is not consistent with dispatchCommand Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants