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

Function onPressStart

packages/react-aria/src/toggle/useToggle.ts:137–147  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

135 let [isLabelPressed, setLabelPressed] = useState(false);
136 let {pressProps: labelProps} = usePress({
137 onPressStart(e) {
138 // Keyboard interactions are handled directly on the input.
139 if (e.pointerType === 'keyboard' || e.pointerType === 'virtual') {
140 e.continuePropagation();
141 return;
142 }
143
144 onPressStart?.(e);
145 onPressChange?.(true);
146 setLabelPressed(true);
147 },
148 onPressEnd(e) {
149 // Keyboard interactions are handled directly on the input.
150 if (e.pointerType === 'keyboard' || e.pointerType === 'virtual') {

Callers

nothing calls this directly

Calls 2

onPressChangeFunction · 0.85
continuePropagationMethod · 0.65

Tested by

no test coverage detected