const TEXT_ENTRY_SELECTOR = 'textarea, [contenteditable=true], input:not([type=checkbox], [type=radio], [type=file], [type=range], [type=color], [type=button], [type=submit])' // Whether focusing this element raises the on-screen keyboard (a text input, textarea or // contenteditable), as opposed to a button or a checkbox. export function isTextEntryElement(element: EventTarget | null): boolean { return element instanceof Element && element.matches(TEXT_ENTRY_SELECTOR) }