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

Function onBlur

packages/react-aria/src/combobox/useComboBox.ts:269–282  ·  view source on GitHub ↗
(e: FocusEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

267 });
268
269 let onBlur = (e: FocusEvent<HTMLInputElement>) => {
270 let blurFromButton = buttonRef?.current && buttonRef.current === e.relatedTarget;
271 let blurIntoPopover = nodeContains(popoverRef.current, e.relatedTarget);
272 // Ignore blur if focused moved to the button(if exists) or into the popover.
273 if (blurFromButton || blurIntoPopover) {
274 return;
275 }
276
277 if (props.onBlur) {
278 props.onBlur(e);
279 }
280
281 state.setFocused(false);
282 };
283
284 let onFocus = (e: FocusEvent<HTMLInputElement>) => {
285 if (state.isFocused) {

Callers

nothing calls this directly

Calls 3

nodeContainsFunction · 0.90
onBlurMethod · 0.80
setFocusedMethod · 0.65

Tested by

no test coverage detected