-
Notifications
You must be signed in to change notification settings - Fork 352
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
PF4 Dropdown: No button type submits page when selected #1194
Comments
#1148 should have set a type property on the toggle button, defaulting to 'button' when nothing is passed in. Are you still experiencing the issue? |
I installed the latest react-core v1.48.0, and see the |
Can you try defining component='button' in your DropdownItem mapping? I'm looking at the code and by default it wraps items in an anchor tag, which is possibly the reason for the submission. |
I don't see an anchor tag in the output, but adding component='button' seems to resolve the issue. |
This resolves the issue at patternfly/patternfly-react#1194
Looking at the generated code by the PF4 Dropdown, it creates a button without any specified type, which (by default) attempts to submit the page/form. This causes the page to refresh and we end up with a blank page due to a submit error.
PF4 Dropdown output:
The workaround I'm forced to implement prevents the onClick event from propagating any higher.
Dropdown usage:
The text was updated successfully, but these errors were encountered: