chore: fix eslint error. #473

pull/475/head
jaywcjlove 1 year ago
parent 4fc526d72e
commit 99025bbc59

@ -214,8 +214,9 @@ function filter(event) {
tagName tagName
} = target; } = target;
let flag = true; let flag = true;
const isInput = tagName === 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type);
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select> // ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>
if (target.isContentEditable || (tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) { if (target.isContentEditable || (isInput || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) {
flag = false; flag = false;
} }
return flag; return flag;

File diff suppressed because one or more lines are too long

@ -212,8 +212,9 @@ function filter(event) {
tagName tagName
} = target; } = target;
let flag = true; let flag = true;
const isInput = tagName === 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type);
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select> // ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>
if (target.isContentEditable || (tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) { if (target.isContentEditable || (isInput || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) {
flag = false; flag = false;
} }
return flag; return flag;

3
dist/hotkeys.js vendored

@ -218,8 +218,9 @@
tagName tagName
} = target; } = target;
let flag = true; let flag = true;
const isInput = tagName === 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type);
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select> // ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>
if (target.isContentEditable || (tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) { if (target.isContentEditable || (isInput || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly) {
flag = false; flag = false;
} }
return flag; return flag;

File diff suppressed because one or more lines are too long

@ -51,8 +51,8 @@ function getAllKeyCodes() {
function filter(event) { function filter(event) {
const target = event.target || event.srcElement; const target = event.target || event.srcElement;
const { tagName } = target; const { tagName } = target;
let flag = true, let flag = true;
isInput = tagName == 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type); const isInput = tagName === 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type);
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select> // ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>
if ( if (
target.isContentEditable target.isContentEditable

Loading…
Cancel
Save