Files
OpenCut/apps/web/src/utils/browser.ts
T

18 lines
339 B
TypeScript
Raw Normal View History

2026-01-31 00:20:04 +01:00
export function isTypableDOMElement({
element,
}: {
element: HTMLElement;
}): boolean {
if (element.isContentEditable) return true;
if (element.tagName === "INPUT") {
return !(element as HTMLInputElement).disabled;
}
if (element.tagName === "TEXTAREA") {
return !(element as HTMLTextAreaElement).disabled;
}
return false;
}