-
Notifications
You must be signed in to change notification settings - Fork 64
Fix deleting selected attachments #507
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
Fix deleting selected attachments #507
Conversation
The cached selection may be frozen, causing '_cachedNodes' read-only error. Use fresh $getSelection() instead of this.#selection.current. Related: facebook/lexical#6290
Same frozen selection issue in #withCurrentNode() - use fresh $getSelection().
|
Added a second fix in 6fd45b8 - the |
|
I'm experiencing the same issue and can confirm that this PR fixes it for me. Thanks for fixing! |
|
Hey @bluesnotred thanks for looking into this one. I think the problem here was related to having some sort of stale assets. I could reproduce with the version from main when building the assets with |
In development mode, Lexical freezes the selection objects, including _cachedNodes. When your code tried to modify _cachedNodes, it threw: TypeError: Cannot assign to read only property '_cachedNodes' of object '#<_NodeSelection>' Related #507 (comment) Also, always generate source maps
|
Will prevent this here #540 |
|
Tentatively closing @bluesnotred @ksweetie @OtherCroissant. Please let me know if you are still experiencing the issue with latest version. |
|
@jorgemanrubia I still have the same error deleting the attachments. Although I have the new table feature now, so the new version seems to be loaded?
I also don't see the html content of the lexxy editor in my console anymore so the development mode seems to be disabled correctly |
|
Thanks @OtherCroissant. How are you installing Fizzy in your app? Using the gem or via the NPM package? I would like to reproduce this. I have tried to update the gem in Fizzy and not having issues there with deleting attachments. |
|
Oh I see it is included via the NPM package. Maybe that is the key. I will look into it. |
…odes in development #540 #507 (comment)
…odes in development #540 #507 (comment)
…odes in development #540 #507 (comment)
…odes in development #540 #507 (comment)
…odes in development #540 #507 (comment)
|
@OtherCroissant I just released a new version that should take care of this one https://github.com/basecamp/lexxy/releases/tag/v0.1.27.beta I would appreciate it if you can confirm. Thanks! |
|
Hi everyone. I was having this same issue in a project that has a LOT of JavaScript going on, so I don't know if my experience is pure enough to be useful. However, 0.1.27-beta fixes this issue and I can now delete inserted attachments (images and mentions). The work here is appreciated, we're hoping to use Lexxy as soon as it's viable. |
|
Great thanks for confirming @seanhogge |
|
Works now for me as well!! Thanks! |
|
Hey Jorge, thanks for looking into this. I've confirmed the fix works:
Appreciate the thorough fix. |


Selecting an image and pressing Backspace/Delete throws:
TypeError: Cannot assign to read only property '_cachedNodes' of object '#<_NodeSelection>'
The cached
this.#selection.currentmay be frozen after certain Lexical operations. Using fresh$getSelection()instead fixes this.Related: facebook/lexical#6290