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: [iframe] Editing a LinkNode Inserts an Extra Span When Modifying Text Before the Last Character #7123

Open
talaat197 opened this issue Feb 3, 2025 · 1 comment
Labels
iframe Issues that happen when multiple documents are involved

Comments

@talaat197
Copy link

Editing LinkNode cause another span to be created after the LinkNode, happens only if we start to add characters before the last character of the LinkNode.

Lexical version: 0.20.0

Steps To Reproduce

  1. open the provided CodeSandbox
  2. you will find a link already in the document "Lexical"
  3. put the cursor between 'a' and 'l' and start typing
  4. you will find that another span is been created after the linkNode, so 2 spans been updated at the same time

Link to CodeSandbox example:
https://stackblitz.com/edit/facebook-lexical-3ztsmofg?file=src%2Fmain.ts,package.json,src%2FprepopulatedRichText.ts

The current behavior

a new span been created and updated

The expected behavior

No spans been created just the current LinkNode been updated

LinkNode.bug.mp4
@etrepum etrepum added the iframe Issues that happen when multiple documents are involved label Feb 3, 2025
@etrepum etrepum changed the title Bug: Editing a LinkNode Inserts an Extra Span When Modifying Text Before the Last Character Bug: [iframe] Editing a LinkNode Inserts an Extra Span When Modifying Text Before the Last Character Feb 3, 2025
@etrepum
Copy link
Collaborator

etrepum commented Feb 3, 2025

This looks like an iframe bug, if you don't use an iframe this won't happen. Currently the only tested configuration is where the editor and the contentEditable are in the same document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iframe Issues that happen when multiple documents are involved
Projects
None yet
Development

No branches or pull requests

2 participants