exclude text inputs from paste handler

This commit is contained in:
Danny Coates 2019-01-29 12:43:09 -08:00
parent c0d8300a8e
commit 87a517a169
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ function getString(item) {
export default function(state, emitter) { export default function(state, emitter) {
window.addEventListener('paste', async event => { window.addEventListener('paste', async event => {
if (state.route !== '/' || state.uploading) return; if (state.route !== '/' || state.uploading) return;
if (event.target.type === 'password') return; if (['password', 'text'].includes(event.target.type)) return;
const items = Array.from(event.clipboardData.items); const items = Array.from(event.clipboardData.items);
const transferFiles = items.filter(item => item.kind === 'file'); const transferFiles = items.filter(item => item.kind === 'file');