fix(utils): explicitly exclude file type from text inputs

This commit is contained in:
Paul Chavard 2022-08-02 17:46:57 +02:00
parent b446e4867f
commit fdbcdfd043
2 changed files with 85 additions and 3 deletions

View file

@ -297,7 +297,7 @@ export function isTextInputElement(
): element is HTMLInputElement {
return (
['INPUT', 'TEXTAREA'].includes(element.tagName) &&
element.type != 'checkbox' &&
element.type != 'radio'
typeof element.type == 'string' &&
!['checkbox', 'radio', 'file'].includes(element.type)
);
}