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

Function onFocus

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

onFocusMethod · 0.80
setFocusedMethod · 0.65

Tested by

no test coverage detected