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

Function onFocus

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

onFocusMethod · 0.80
setFocusedMethod · 0.65

Tested by

no test coverage detected