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
Unexpected Form Submission on Combobox having no results #3323
Comments
The combobox is rendered within the form element in the DOM, making it technically part of it. I'm not sure if there's a way we can address this in the library without impacting those who genuinely want a combobox within a form. But I'm open to suggestions. As an alternative, you can render the <SelectPopover portal> |
If I understand the issue correctly it is because the focus does not remain trapped inside the Combobox popover, when no ComboboxItem are rendered, maybe we should simulate that focus anyway? |
A possible workaround may be to render a "fake" ComboboxItem during the "No results" state |
@diegohaz Thank you for your suggestion. I appreciate your responsiveness to the issue. While using |
Sounds like you're describing |
You could use the getPersistentElements to allow interaction with external elements. <SelectPopover portal className="select-dialog"> <Modal
{...props}
getPersistentElements={() => document.querySelector('.select-dialog')}
/> |
I think that what @marilari88 meant, is that combining the combobox with portal inside a form, inside a modal dialog, it breaks:
|
If that's the case and |
https://open-ui.org/components/selectlist/#keyboard-behavior suggests that this is correct behavior? |
Current behavior
When using the ComboBox and performing a search that results in an empty list, pressing the 'Enter' key triggers the form submission
Steps to reproduce the bug
Expected behavior
The form submission should not be triggered as the combobox field is not a part of the form
Workaround
add form attribute to the combobox
Or #3323 (comment)
Possible solutions
No response
The text was updated successfully, but these errors were encountered: