tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

[Bug]: Changing text color does not affect underline

Open Daniel-Rauh opened this issue 2 years ago • 8 comments

Which packages did you experience the bug in?

react, extension-underline, extension-color

What Tiptap version are you using?

2.1.12

What’s the bug you are facing?

When underlining text that had it's color changed or when changing the color of underlined text the underline is always black. There should be an option to make it the same color as the text.

What browser are you using?

Chrome

Code example

No response

What did you expect to happen?

Expected the underline color to be the same as the text color

Anything to add? (optional)

No response

Did you update your dependencies?

  • [X] Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • [ ] Yes, I’m a sponsor. 💖

Daniel-Rauh avatar Jan 03 '24 08:01 Daniel-Rauh

I stumbled into the same issue today. To add on this - the problem is the order of the html tags: image

The underline tag should be inside span tag not around it.

MaximilianKresse avatar Feb 29 '24 11:02 MaximilianKresse

This affects me too. I also noticed it happens with strikethrough.

laurenga avatar Mar 08 '24 17:03 laurenga

You can check this comment here

https://github.com/ueberdosis/tiptap/discussions/4689#discussioncomment-10131672

ymc9 avatar Jul 23 '24 23:07 ymc9

hm, maybe we could just change the priority of the extensions to have them apply in a different order? I forgot how the order is set

nperez0111 avatar Jul 24 '24 06:07 nperez0111

@nperez0111 Changing the order of extensions did the trick for me, thanks!

EskelCz avatar Jul 30 '24 11:07 EskelCz

@nperez0111 Changing the order of extensions did the trick for me, thanks!

What order did you set so we can resolve this in future versions?

nperez0111 avatar Jul 31 '24 00:07 nperez0111

@nperez0111 maybe my config was bad to start with

before:

const extensions = [
      StarterKit,
      Underline,
      TextStyle,
      ...

after:

const extensions = [
      StarterKit,
      TextStyle,
      Underline,
      ...

EskelCz avatar Jul 31 '24 11:07 EskelCz

@nperez0111 Just found out that strikethrough suffers with the same exact issue. Had to put TextStyle extension first.

EskelCz avatar Aug 01 '24 23:08 EskelCz

This is now resolved in v2.6.0 (I gave text style a higher priority)

nperez0111 avatar Aug 13 '24 07:08 nperez0111