lexical icon indicating copy to clipboard operation
lexical copied to clipboard

[lexical-rich-text][lexical-playground][lexical-react]: Update selection when something is selected inside a DecoratorNode

Open GermanJablo opened this issue 11 months ago • 2 comments

Closes:

  • https://github.com/facebook/lexical/issues/7071
  • https://github.com/facebook/lexical/issues/6632

This PR:

  • Update selection when something is selected inside a DecoratorNode.
  • The logic is centralized in RichTextPlugin so that it does not have to be repeated in all nodes. This had caused some nodes to forget to implement this logic, or to be inconsistent:
    • Sometimes it seems that the intention was to deselect a decorator node if it was already selected with a second click.
    • Other times it was intended to deselect if shift + click was pressed.
    • Other times clicking on a selected decorator node leaves the selection unchanged. This is the default behavior chosen in this PR, but if anyone prefers either of the above two options please say so.
  • I took the opportunity to improve a couple of details in Excalidraw. The option to open with double click was removed for reasons of simplicity and consistency, considering that the component already has a button at the top right to open the editor.

By having the behavior of the click command centralized, fixing other bugs later should be easier, such as:

  • https://github.com/facebook/lexical/issues/7070
  • https://github.com/facebook/lexical/issues/3748

GermanJablo avatar Jan 20 '25 21:01 GermanJablo

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 9:35pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 9:35pm

vercel[bot] avatar Jan 20 '25 21:01 vercel[bot]

size-limit report 📦

Path Size
lexical - cjs 29.07 KB (0%)
lexical - esm 28.89 KB (0%)
@lexical/rich-text - cjs 38.08 KB (+0.11% 🔺)
@lexical/rich-text - esm 30.98 KB (-0.01% 🔽)
@lexical/plain-text - cjs 36.57 KB (0%)
@lexical/plain-text - esm 28.26 KB (0%)
@lexical/react - cjs 39.84 KB (0%)
@lexical/react - esm 32.34 KB (0%)

github-actions[bot] avatar Jan 20 '25 21:01 github-actions[bot]

Closing as stale, please re-open when/if you intend to complete it.

etrepum avatar Sep 03 '25 22:09 etrepum