fix: fix filter func (#473)

do not ignore several types of INPUT
pull/475/head
rockindolphin 1 year ago committed by GitHub
parent adc70eb336
commit 4fc526d72e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -51,11 +51,12 @@ function getAllKeyCodes() {
function filter(event) {
const target = event.target || event.srcElement;
const { tagName } = target;
let flag = true;
let flag = true,
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>
if (
target.isContentEditable
|| ((tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly)
|| ((isInput || tagName === 'TEXTAREA' || tagName === 'SELECT') && !target.readOnly)
) {
flag = false;
}

Loading…
Cancel
Save