MCPcopy Create free account
hub / github.com/block/buzz / isEditableTarget

Function isEditableTarget

desktop/src/app/navigation/useBackForwardControls.ts:17–28  ·  view source on GitHub ↗
(target: EventTarget | null)

Source from the content-addressed store, hash-verified

15};
16
17function isEditableTarget(target: EventTarget | null): boolean {
18 if (!(target instanceof HTMLElement)) {
19 return false;
20 }
21
22 return (
23 target.isContentEditable ||
24 target.closest(
25 'input, textarea, select, [contenteditable=""], [contenteditable="true"]',
26 ) !== null
27 );
28}
29
30export function useBackForwardControls() {
31 const router = useRouter();

Callers 1

useBackForwardControlsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected