MCPcopy Create free account
hub / github.com/adobe/react-spectrum / cleanup

Function cleanup

packages/react-aria/src/interactions/utils.ts:193–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191 root.addEventListener('focus', onFocus, true);
192
193 let cleanup = () => {
194 cancelAnimationFrame(raf);
195 root.removeEventListener('blur', onBlur, true);
196 root.removeEventListener('focusout', onFocusOut, true);
197 root.removeEventListener('focusin', onFocusIn, true);
198 root.removeEventListener('focus', onFocus, true);
199 ignoreFocusEvent = false;
200 isRefocusing = false;
201 };
202
203 let raf = requestAnimationFrame(cleanup);
204 return cleanup;

Callers 15

domHelpers.test.jsFile · 0.85
FocusScope.test.jsFile · 0.85
onFocusOutFunction · 0.85
onFocusInFunction · 0.85
setStyleFunction · 0.85
mergeRefsFunction · 0.85
useOverlayPositionFunction · 0.85

Calls 1

removeEventListenerMethod · 0.80

Tested by

no test coverage detected