diff --git a/packages/react-events/src/dom/Press.js b/packages/react-events/src/dom/Press.js index ce8b745254c61..267240776af6e 100644 --- a/packages/react-events/src/dom/Press.js +++ b/packages/react-events/src/dom/Press.js @@ -635,6 +635,11 @@ const pressResponderImpl = { if (isFunction(onPress) && isScreenReaderVirtualClick(nativeEvent)) { state.pointerType = 'keyboard'; state.pressTarget = event.responderTarget; + const preventDefault = props.preventDefault; + + if (preventDefault !== false) { + nativeEvent.preventDefault(); + } dispatchEvent(event, onPress, context, state, 'press', DiscreteEvent); } break; diff --git a/packages/react-events/src/dom/__tests__/Press-test.internal.js b/packages/react-events/src/dom/__tests__/Press-test.internal.js index 159a039bbc691..5e155f5ad839f 100644 --- a/packages/react-events/src/dom/__tests__/Press-test.internal.js +++ b/packages/react-events/src/dom/__tests__/Press-test.internal.js @@ -423,7 +423,9 @@ describe.each(environmentTable)('Press responder', hasPointerEvents => { it('is called once after virtual screen reader "click" event', () => { const target = createEventTarget(ref.current); - target.virtualclick(); + const preventDefault = jest.fn(); + target.virtualclick({preventDefault}); + expect(preventDefault).toBeCalled(); expect(onPress).toHaveBeenCalledTimes(1); expect(onPress).toHaveBeenCalledWith( expect.objectContaining({