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

HorizontalRule: fix setHorizontalRule putting cursor at non-text positions #4319

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

bdbch
Copy link
Member

@bdbch bdbch commented Aug 11, 2023

Please describe your changes

This PR fixes an issue with the setHorizontalRule function placing the selection at non-text positions (for example doc) after inserting a HorizontalRule node.

How did you accomplish your changes

I modified the insert positions of the functions and added a small part of code to determine the next text-node which the cursor can be placed in.

How have you tested your changes

Locally with the HorizontalRule demo.

How can we verify your changes

See above

Remarks

Nothing

Checklist

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

Related issues

fixes #3003

@bdbch bdbch added Type: Bug The issue or pullrequest is related to a bug Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. labels Aug 11, 2023
@bdbch bdbch self-assigned this Aug 11, 2023
@bdbch bdbch requested a review from svenadlung as a code owner August 11, 2023 15:20
@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit eb0df01
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/64d668e4c81f2b0008067ea4
😎 Deploy Preview https://deploy-preview-4319--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 dd6d3d3 into develop Aug 16, 2023
@bdbch bdbch deleted the bdbch/3003-hr-selection branch August 16, 2023 00:49
@rfgamaral
Copy link
Contributor

@bdbch I'm finding that this change isn't working that well:

firefox_mjKS0cpkoG.mp4

I'm also having a strange issue in your Typist editor:

firefox_gLIsARPgGI.mp4

For some reason, it's trying to insert an hashtag suggestion. This could either be a problem on our side, or a related issue to the bug above.

For now - and even before upgrading tiptap to v2.1 - we've been using a custom horizontal rule extension, with this patch, that seems to work much better.

Would be nice to remove this work around from our side, but unfortunately, this behaviour is still buggy on tiptap.

@svenadlung
Copy link
Member

@rfgamaral just to be sure: this got fixed for you with 2.1.6, did it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

TextSelection warning with Horitzontal Rule
3 participants