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] Typing email address with three domain segments, auto-link leaves editor in broken state #542

Closed
2 tasks done
mrcrowl opened this issue Jul 23, 2024 · 5 comments · Fixed by #563
Closed
2 tasks done
Labels
bug Something isn't working released

Comments

@mrcrowl
Copy link
Contributor

mrcrowl commented Jul 23, 2024

If you want to ask for support or request features, sponsor the project and contact me over email.

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
Typing an email address with more than two domain levels leaves the editor in a broken state (e.g. [email protected]) due to auto-link plugin.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://mdxeditor.dev/editor/demo
  2. Insert a cursor on a new line.
  3. Start typing an email address with more than three domain segments (e.g. [email protected])
  4. When the .com part is typed the email is "auto-linked".
  5. After continuing to type .au the backspace key no longer works (it selects the text instead of removing).
  6. Console shows errors (on a local build, the errors are similar to this):
    Error: Expected node 13 to have a parent.
    at _TextNode.getParentOrThrow (Lexical.dev.mjs:3460:15)
    at $shouldInsertTextAfterOrBeforeTextNode (Lexical.dev.mjs:1032:23)
    at $shouldPreventDefaultAndInsertText (Lexical.dev.mjs:2398:3)
    at Lexical.dev.mjs:2689:34
    at $beginUpdate (Lexical.dev.mjs:8093:5)
    at updateEditor (Lexical.dev.mjs:8169:5)
    at onBeforeInput (Lexical.dev.mjs:2607:3)
    at Lexical.dev.mjs:2344:61
    at HTMLDivElement.<anonymous> (Lexical.dev.mjs:3163:9)

Expected behavior
After typing .au the full email address should have been converted into a link, and the editor state should remain editable.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
@mrcrowl mrcrowl added the bug Something isn't working label Jul 23, 2024
@petyosi
Copy link
Contributor

petyosi commented Jul 24, 2024

This is entirely a Lexical behavior, have you searched for a similar problem on their side?

@mrcrowl
Copy link
Contributor Author

mrcrowl commented Jul 25, 2024

The same test works correctly on the lexical playground site: https://playground.lexical.dev/

@petyosi
Copy link
Contributor

petyosi commented Jul 25, 2024

Searching for issues in their repo found this - facebook/lexical#6430.

Since this will be fixed once Lexical releases a new version, I will close this issue.

@petyosi petyosi closed this as completed Jul 25, 2024
@mrcrowl
Copy link
Contributor Author

mrcrowl commented Aug 5, 2024

facebook/lexical has now released v0.17.0. Is there a rough timeframe for when this update will be included in mdx-editor?

mrcrowl added a commit to mrcrowl/editor that referenced this issue Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

🎉 This issue has been resolved in version 3.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment