Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autocomplete): avoid default event prevention on enter key press primefaces#6788 #7108

Conversation

SamVanini
Copy link

Defect Fixes

Fixes #6788

The default event prevention added with commit 439ece1 does not allow to submit a form using enter and numpad enter keys

Copy link

vercel bot commented Jan 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Updated (UTC)
primevue ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 8:43pm
primevue-v3 ⬜️ Ignored (Inspect) Visit Preview Jan 16, 2025 8:43pm

@tugcekucukoglu
Copy link
Member

Unfortunately, this PR does not solve the problem. Open to a new solution.

Thanks for your contribution.

@SamVanini
Copy link
Author

Hello @tugcekucukoglu , I have seen that my PR unfortunately does not solve the problem.

Could you please share which was the side effects created by my commit ?
I'd like to find the solution to this issue, contributing actively to this component library, and a hint would be very much appreciated

My reasoning was the following one:

The event.prevetnDefault() placed at the end of onEnterKey method cancels the event, meaning that any default action normally taken by the implementation as a result of the event will not occur, as per MDN documentation.
Removing this line, the event bubbles and reaches the form in order to trigger its submission.

Obviously I am missing some piece, because that line has been added for some reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoComplete: Enter does not submit form (PrimeVue 4)
2 participants