Skip to content

Commit

Permalink
fix: fix filter func (#473)
Browse files Browse the repository at this point in the history
do not ignore several types of INPUT
  • Loading branch information
rockindolphin authored Feb 2, 2024
1 parent adc70eb commit 4fc526d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ function getAllKeyCodes() {
function filter(event) {
const target = event.target || event.srcElement;
const { tagName } = target;
let flag = true;
let flag = true,

Check failure on line 54 in src/index.js

View workflow job for this annotation

GitHub Actions / build-deploy

Split 'let' declarations into multiple statements
isInput = tagName == 'INPUT' && !['checkbox', 'radio', 'range', 'button', 'file', 'reset', 'submit', 'color'].includes(target.type);

Check failure on line 55 in src/index.js

View workflow job for this annotation

GitHub Actions / build-deploy

Expected indentation of 4 spaces but found 6

Check failure on line 55 in src/index.js

View workflow job for this annotation

GitHub Actions / build-deploy

'isInput' is never reassigned. Use 'const' instead

Check failure on line 55 in src/index.js

View workflow job for this annotation

GitHub Actions / build-deploy

Expected '===' and instead saw '=='
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>
if (
target.isContentEditable
|| ((tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly)
|| ((isInput || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly)
) {
flag = false;
}
Expand Down

0 comments on commit 4fc526d

Please sign in to comment.