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

Prevent history checkpoints during backspace in empty editor #5063

Merged
merged 2 commits into from
May 9, 2024

Conversation

Nantris
Copy link
Contributor

@Nantris Nantris commented Apr 12, 2024

Please describe your changes

Prevent running clearNodes when there's no nodes to clear to avoid useless history checkpoints

How did you accomplish your changes

Check if the first node in editor is a paragraph and if so, return false

How have you tested your changes

Locally

How can we verify your changes

Locally and checking editor.state.history$.done.eventCount

Remarks

It would be better if there were some schema.nodes.defaultNode, but in lieu of that I've assumed paragraph is the default.

Checklist

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

Related issues

#5062

Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit c05a671
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/6619ba4157fd86000781e5c9
😎 Deploy Preview https://deploy-preview-5063--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 configuration.

@bdbch bdbch merged commit c52a602 into ueberdosis:main May 9, 2024
14 checks passed
@Nantris Nantris deleted the patch-5 branch May 9, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants