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

Function Component

packages/react-aria/test/interactions/useKeyboard.test.js:119–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117 describe('chaining and propagation', () => {
118 it('should stop propagation if any shortcut handling that key stops propagation', async () => {
119 let Component = () => {
120 let {keyboardProps} = useKeyboard({
121 shortcuts: {
122 ArrowLeft: () => {
123 return;
124 }
125 }
126 });
127 let {keyboardProps: keyboardProps2} = useKeyboard({
128 shortcuts: {
129 Enter: () => {
130 return;
131 }
132 },
133 ...keyboardProps
134 });
135 return <button {...keyboardProps2}>Save</button>;
136 };
137 let onKeyDown = jest.fn();
138 render(
139 <div onKeyDown={onKeyDown}>

Callers

nothing calls this directly

Calls 1

useKeyboardFunction · 0.90

Tested by

no test coverage detected