hackerwins / react-summernote

Summernote (Super simple WYSIWYG editor) adaptation for react
http://summernote.org
MIT License
232 stars 109 forks source link

Toolbar button get active class after typing, not clicking #43

Open jordan-jarolim opened 6 years ago

jordan-jarolim commented 6 years ago

Hi all,

trying to use react-summernote in my project, everything seems to work good except one tiny problem. Once you click any toolbar button (bold/italic/...) the button doesn't get "active" class immediately. This class is added/removed only when user starts to type by

$note.on('summernote.keyup summernote.mouseup summernote.change', function () {
  context.invoke('buttons.updateCurrentStyle');
});

It works good on your demo page, theres a onClick handler method createInvokeHandlerAndUpdateState but in react-summernote is createInvokeHandler. Is this known issue? Will this be fixed any soon? Thanks :)

andrii-baran-nfgp commented 4 months ago

I have the same issue with jquery plugin. It looks like buttons are activated properly, but after that everything is cleared (visually buttons are blinking). I found a workaround. Hope this help


$note.on('summernote.mouseup', function () {
  setTimeout(function() {
    context.invoke('buttons.updateCurrentStyle');
  }, 200); 
});