Просмотр исходного кода

fix: attach paste listener on message field

paste listener prevents default behavior in unexpected cases
such as pasting a password in the passworddecrypt field

attaching the paste listener on the message field
instead of the whole document should fix this problem
Nicolas Lepage 1 год назад
Родитель
Сommit
13f5922397
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      js/privatebin.js

+ 1 - 1
js/privatebin.js

@@ -3382,7 +3382,7 @@ jQuery.PrivateBin = (function($) {
          * @function
          */
         function addClipboardEventHandler() {
-            $(document).on('paste', function (event) {
+            $('#message').on('paste', function (event) {
                 const items = (event.clipboardData || event.originalEvent.clipboardData).items;
                 const files = [...items]
                                     .filter(item => item.kind === 'file')