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

[4.x] Fix Bard sets being inserted too early #9216

Merged
merged 5 commits into from
Jan 16, 2024

Conversation

duncanmcclean
Copy link
Member

This pull request attempts to fix Bard sets being inserted too early / in the wrong place.

For example: if you had always_show_set_button set to true and your cursor was positioned at the end of a line, the set would be added just before the last character on that line, rather than after it.

This meant your content looked like this:

This is a sentence

[Bard set]

.

The rest of your content...

I haven't touched Bard / TipTap much but this seems to resolve the issue for me.

Fixes #7858.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you're inserting into a blank line (like you would if you had the "always show button" disabled) then the blank line appears before the set, which feels a bit odd.

Previously, the set appears exactly where the button was, which feels right. The blank line would appear after the newly inserted set.

@jasonvarga
Copy link
Member

Your PR does fix the other issue though. 👍

@duncanmcclean duncanmcclean marked this pull request as draft January 10, 2024 12:28
@duncanmcclean duncanmcclean marked this pull request as ready for review January 16, 2024 20:37
@jasonvarga jasonvarga merged commit f454424 into 4.x Jan 16, 2024
35 checks passed
@jasonvarga jasonvarga deleted the fix/bard-sets-being-inserted-in-the-wrong-place branch January 16, 2024 20:53
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.

Bard "Add set" moves cursor one character to the left before inserting.
2 participants