Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pasting does not fire tbwchange

See original GitHub issue


It seems that when you paste text into the editor, the tbwchange event is not fired at all unless you have the removeformatPasted option set to true. In the issue #579 it was reported that the tbwchange event was not fired for IE 11 when this flag is set to true, and the fix was to simply add the trigger but this does not resolve this issue.

I have been able to fix it on our local copy of trumbowyg by changing the code at line 690 from

setTimeout(function () {
    t.semanticCode(false, true);
    t.$c.trigger('tbwpaste', e);
}, 0);


setTimeout(function () {
    t.semanticCode(false, true);
    t.$c.trigger('tbwpaste', e);
    t.$c.trigger('tbwchange', e);
}, 0);

And removing the t.$c.trigger('tbwchange', e); on line 679 as this would no longer be necessary.

I am unsure whether this has any further implications to other things but this resolves the issue.

I’ve tested this on Chrome for Windows and Mac, both of which showed the issue. The only way to make the value actually change was to leave the input field, then give it focus again.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

geoffbeaumontcommented, Jun 20, 2018

The simple workaround is to hook your code up to the tbwpaste event as well as tbwchange (and possibly tbwblur too if you want to be fully belt and braces).

Alex-Dcommented, Nov 15, 2018

Done in next version which will be deployed soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation | Trumbowyg: A lightweight WYSIWYG editor
Trumbowyg is a jQuery plugin for create WYSIWYG editor. ... Don't forget to load Trumbowyg CSS in the <head> , or load your...
Read more >
onChange not firing in React 15.1.0 + IE11 when paste text ...
On IE11/React 15.1.0 when copy/paste data to a text field using right click on mouse, onChange is not firing, this works fine in...
Read more >
Vue.js Component For Trumbowyg Editor
A Vue.js 2 component/plugin to implement the Trumbowyg WYSIWYG editor on the app.
Read more >
Trumbowyg text editor - Plunker
eventNamespace = 'trumbowyg-event'; // Keyboard shortcuts are load in this array t.keys ... c.trigger('tbwchange', e); } catch (d) { // Not IE t....
Read more >
#10701 (Editor event "paste" no longer fires when ... - CKEditor
In 4.1.3, the paste event is not fired when the users pastes via Ctrl+V and registered functions are not invoked. Pasting via the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found