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(Combobox): stop event propagation on enter #1279

Merged

Conversation

ragulka
Copy link
Contributor

@ragulka ragulka commented Sep 9, 2024

This PR is my attempt of fixing the bug described in #1278

Important: the test case here is a false-positive: when I remove the event.stopPropagation() line, it still passes. I'm not surer why - I don't have too much experience with vitest and if event bubbling actually happens in the test environment?

Since we're not using a real browser, the enter event bubbling up to form is not causing a form submit in tests. So, instead of testing for the handleSubmit not to be called, I updated the test to check if the enter event bubbled up to the form.

With this change, removing the event.stopPropagation() call will cause the test to fail.

@zernonia zernonia merged commit ff5abb0 into unovue:main Sep 17, 2024
3 checks passed
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.

2 participants