onPaste() just doesn't work anymore?
See original GitHub issueWith summernote v0.6.16, my onPaste
callback works on Chrome (v46), but not on Firefox (v41).
With v0.7.0, it isn’t triggered on neither browser.
I tried both onPaste
and onpaste
but none of them works.
myElement.summernote({
// all other settings
onPaste: function (e) {
// ...some code to clear up undesired formatting from the source...
}
});
What happened? Am I doing something wrong?
The onPaste
event is quite useful to remove undesired formatting when a user copies text from somewhere else (i.e. to standardize what and how text can be formatted).
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
jQuery on("paste") for the first time doesn't grab or pass the value
Solution is to set the timeout. Right code looks like that and works just fine. $("#link").on("paste" ...
Read more >Element: paste event - Web APIs | MDN
The paste event is fired when the user has initiated a "paste" action through the browser's user interface.
Read more >preventDefault does not work in onPaste - CodeMirror
In a regular textarea, calling e.preventDefault() from onPaste cancels the paste. See for example jsfiddle where pasting is totally blocked ...
Read more >How to Prevent Pasting into an Input - David Walsh Blog
The onpaste attribute lets us prevent pasting into the form. Adding the autocomplete attribute as well as preventing drag and drop into the ......
Read more >How to prevent pasting into input fields - DEV Community
This code cancels the default behaviour of the paste event (i.e. pasting the contents of the clipboard into the input element). When the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hi @ybwxhzlw
The way to define the callback function was changed in 0.7.0 .
refer to below code.
@stefl0n, @ybwxhzlw Thanks for reporting and waiting. This bug was fixed on develop branch and it will be released at v0.7.0.