You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered:
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
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
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
The text was updated successfully, but these errors were encountered: