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

Marks not splitting when combining attributes #1039

Closed
cpauwels opened this issue Apr 13, 2021 · 5 comments
Closed

Marks not splitting when combining attributes #1039

cpauwels opened this issue Apr 13, 2021 · 5 comments
Assignees
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@cpauwels
Copy link

What happens?
It's hard to explain, but here is a screen recording of the issue, including with the desired behavior in Google Docs:

Screen Recording 2021-04-13 at 11 58 38 AM

I created a "Style" mark (source in the CSB below) that allows me to set the color and font-style on a span. It works great when only setting one of the two attributes, or when setting multiple attributes to a same selection, but when the selection spans two "Style" marks, the whole selection gets included in the left-most mark, instead of setting the attributes separately on each mark, or creating a third mark if needed.

Is there a way to get to my mark to behave similar to Google Docs? I couldn't figure it out from the docs.

Thanks

How can others reproduce the issue?
I created a codesandbox here:
https://codesandbox.io/s/tiptap-issue-template-forked-sjflo?fontsize=14&hidenavigation=1&theme=dark&file=/src/tiptap-style.js

You can try it out here:
https://sjflo.csb.app/

@philippkuehn
Copy link
Contributor

Ah, yes I can confirm this is a bug.

@cpauwels
Copy link
Author

Is there any way to emulate the desired behavior with the current state of tiptap, or is it best to wait for a fix?

@philippkuehn
Copy link
Contributor

you could use two different marks for now.

@cpauwels
Copy link
Author

Good idea! Tried that and it works pretty well for now (just leads to a whole bunch of nested <span>s 😅)
Thanks!

@hanspagel hanspagel transferred this issue from ueberdosis/tiptap-next Apr 21, 2021
@hanspagel hanspagel added v2 Type: Bug The issue or pullrequest is related to a bug labels Apr 21, 2021
@philippkuehn
Copy link
Contributor

hey, with the latest release, this should now work as expected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants