fix: Cannot read properties of undefined on old Android
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
const inputs = ["input", "select", "button", "textarea"]; // detect if node is a text input element
|
||||
|
||||
export default function isTextInput(element: HTMLElement): boolean {
|
||||
return (
|
||||
export default function isTextInput(element: Element): boolean {
|
||||
return !!(
|
||||
element &&
|
||||
element.tagName &&
|
||||
(inputs.indexOf(element.tagName.toLowerCase()) !== -1 ||
|
||||
element.attributes.getNamedItem("role")?.value === "textbox" ||
|
||||
element.attributes.getNamedItem("contenteditable")?.value === "true")
|
||||
|
||||
Reference in New Issue
Block a user