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

Function onFocus

packages/react-aria/src/select/useSelect.ts:233–247  ·  view source on GitHub ↗
(e: FocusEvent)

Source from the content-addressed store, hash-verified

231 .filter(Boolean)
232 .join(' '),
233 onFocus(e: FocusEvent) {
234 if (state.isFocused) {
235 return;
236 }
237
238 if (props.onFocus) {
239 props.onFocus(e);
240 }
241
242 if (props.onFocusChange) {
243 props.onFocusChange(true);
244 }
245
246 state.setFocused(true);
247 },
248 onBlur(e: FocusEvent) {
249 if (state.isOpen) {
250 return;

Callers

nothing calls this directly

Calls 2

onFocusMethod · 0.80
setFocusedMethod · 0.65

Tested by

no test coverage detected