diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2023-01-01 17:13:45 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2023-01-01 17:13:45 +0100 |
commit | 86f5796a23e12aa9aaf2ec5901d35683d6c60022 (patch) | |
tree | 35407bd800b07535f75fe7571a72d7f246111aae /assets/js | |
parent | 92f3e2b073801f8a7e5302c7f3af70639f84b3cd (diff) |
js: Tokenize pasted text.
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/mumi.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/assets/js/mumi.js b/assets/js/mumi.js index b37b138..dde30a6 100644 --- a/assets/js/mumi.js +++ b/assets/js/mumi.js @@ -139,6 +139,13 @@ var mumi = (function () { form.submit (); }); + inputElement.addEventListener ("input", function (event) { + if (event.inputType === "insertFromPaste") { + event.preventDefault (); + tokenizeText (inputElement, options, tokenInput); + } + }); + /* tokenize existing input text */ if (inputElement.value.length > 0) { tokenizeText (inputElement, options, tokenInput); |