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
This commit is contained in:
Nicolas Lepage 2025-07-31 14:08:40 +02:00
parent 7435097731
commit 13f5922397
No known key found for this signature in database
GPG key ID: B0879E35E66D8F6F

View file

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