Trumbowyg: Bold and Italic buttons not highlighted green when active

Created on 18 Nov 2016  ·  8Comments  ·  Source: Alex-D/Trumbowyg

Informations

Browser + version: Chrome 54.0.2840.98
OS: OSX 10.11.6

How to reproduce the bug?

If you change text to bold or italic in the editor, the button does not highlight green. When you change text to underlined, the underlined button highlights green, same with strikethrough. If you then click away and re-highlight the text it's green for underlined and strikethrough, but not for bold or italic. It would be nice to have this consistent. I think this is related to https://github.com/Alex-D/Trumbowyg/issues/12

core

Most helpful comment

Highlighting on the buttons depends on the option selected within the toolbar btns argument on startup. Since the semantic option is on by default, this should be how you define your toolbar to get the buttons to highlight correctly.

btns: [
    ['strong', 'em', 'underline'],
]

This works because updateButtonPaneStatus is using getTagsRecursive to look for the strong and em tags to match to the button.

All 8 comments

I've tested it, strong and emphasis buttons works.

Did you have disable semantic option?

I close this because of inactivity. Feel free to reopen.

@Alex-D Hi sorry for the late reply.

I've managed to reproduce the bug on https://alex-d.github.io/Trumbowyg/ on my mac in firefox and chrome, see screenshots attached - the first one shows the underline button highlighted white, the second one shows the italic button not highlighted white.

This is when using the 'all plugins' option. Interestingly when you use 'core only', the bold and italic do work but the strikethrough does not.

screen shot 2016-12-08 at 10 10 52

screen shot 2016-12-08 at 10 14 42

Ok, so it's tricky ^^"

Would you be able to remove the closed tag? I don't seem to have the option.

Hi, i just came across this issue. When i disable the semantic option, the highlighting of the pane buttons starts working again. Is this the correct behaviour?

Actually for me after disabling semantic option, flow like pressing Ctrl+B and typing bold characters started working, but buttons aren't highlighted at all.

Highlighting on the buttons depends on the option selected within the toolbar btns argument on startup. Since the semantic option is on by default, this should be how you define your toolbar to get the buttons to highlight correctly.

btns: [
    ['strong', 'em', 'underline'],
]

This works because updateButtonPaneStatus is using getTagsRecursive to look for the strong and em tags to match to the button.

Was this page helpful?
0 / 5 - 0 ratings