MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / targetIsTextField

Function targetIsTextField

frontend/src/utility-functions/input.ts:345–352  ·  view source on GitHub ↗
(target: EventTarget | HTMLElement | undefined)

Source from the content-addressed store, hash-verified

343}
344
345function targetIsTextField(target: EventTarget | HTMLElement | undefined): boolean {
346 if (!(target instanceof HTMLElement)) return false;
347 return (
348 target.isContentEditable ||
349 target instanceof HTMLTextAreaElement ||
350 (target instanceof HTMLInputElement && ["text", "password", "email", "url", "tel", "search", "number", "date", "datetime-local", "month", "time", "week"].includes(target.type))
351 );
352}
353
354function potentiallyRestoreCanvasFocus(e: Event) {
355 const appElement = window.document.querySelector("[data-app-container]");

Callers 4

onContextMenuFunction · 0.85
onPasteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected