MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / detach

Function detach

src/components/Tooltip/focus-open.ts:86–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84}
85
86function detach() {
87 if (listening && typeof window !== 'undefined') {
88 window.removeEventListener('blur', onWindowBlur)
89 window.removeEventListener('focus', onWindowFocus)
90 if (modalityListening) {
91 window.removeEventListener('keydown', onKeyDown, true)
92 window.removeEventListener('pointerdown', onPointerDown, true)
93 }
94 }
95 listening = false
96 modalityListening = false
97 restoredFocusElement = null
98 lastInputWasKeyboard = true
99 if (clearTimer !== null) {
100 clearTimeout(clearTimer)
101 clearTimer = null
102 }
103}
104
105export function subscribeFocusOpenGuards(): () => void {
106 const subscribedSession = session

Callers 2

subscribeFocusOpenGuardsFunction · 0.85
resetFocusOpenGuardsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected