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

fix: clear nodes when cursor at start of empty isolating parent #3943

Merged
merged 5 commits into from
Apr 5, 2023

Conversation

bdbch
Copy link
Contributor

@bdbch bdbch commented Apr 5, 2023

Please describe your changes

This fix will solve the issue that when a cursor is inside an isolating node and the isolating node is empty, the nodes inside are not cleared similar to how they are cleared on the document.

How did you accomplish your changes

Inside the keymap.ts we also check for the current textNodes parent (or direct parent if it is not a textNode) and if said parent is isolating. If we are inside an isolating node, we use the relative parentOffset to check that we're at the start of a node.

How have you tested your changes

  • Used an isolating node to test the behavior, nodes were cleared correctly
  • Used it directly in the document: nodes were still cleared correctly

How can we verify your changes

  1. Create an isolating node
  2. Add content
  3. Make this content a headline
  4. Use backspace to completely remove the content
  5. Use backspace again to clear the headline and turn it back into a paragraph

Checklist

  • The changes are not breaking the editor
  • Added tests where possible
  • Followed the guidelines
  • Fixed linting issues

Related issues

No related issues

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 9b5cc16
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/642d70ccabd2030008c572d1
😎 Deploy Preview https://deploy-preview-3943--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@bdbch bdbch merged commit 7278ee2 into develop Apr 5, 2023
@bdbch bdbch deleted the hotfix/fix-isolating-backspace branch April 5, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants