Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@react-aria/autocomplete/src/useAutocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export function useAutocomplete<T>(props: AriaAutocompleteOptions<T>, state: Aut
// Trigger click action on item when Enter key was pressed.
if (focusedNodeId != null) {
let item = document.getElementById(focusedNodeId);
item?.click();
item?.dispatchEvent(new PointerEvent('click', e.nativeEvent));
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ export const AriaAutocompleteTests = ({renderers, setup, prefix, ariaPattern = '

if (renderers.links) {
describe('with links', function () {
installPointerEvent();
it('should trigger the link option when hitting Enter', async function () {
let {getByRole} = (renderers.links!)();
let input = getByRole('searchbox');
Expand Down