Repository navigation
Make pressing enter submit instance resize modal form - #2586
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
david-crespo
commented
Nov 27, 2024
david-crespo
commented
Nov 28, 2024
| cancelText?: string | ||
| disabled?: boolean | ||
| } & MergeExclusive<{ formId: string }, { onAction: () => void }> | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
yoooo MergeExclusive is my new best friend
charliepark
approved these changes
Nov 28, 2024
david-crespo
enabled auto-merge (squash)
November 28, 2024 04:13
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Dec 4, 2024
oxidecomputer/console@059c551...fd47bee * [fd47bee7](oxidecomputer/console@fd47bee7) tweak bump omicron script to prompt for message * [f6a3c06c](oxidecomputer/console@f6a3c06c) bump omicron for project-scoped oxql endpoint * [4d3a923c](oxidecomputer/console@4d3a923c) oxidecomputer/console#2596 * [576e1842](oxidecomputer/console@576e1842) oxidecomputer/console#2595 * [72b6d43d](oxidecomputer/console@72b6d43d) oxidecomputer/console#2579 * [15e55044](oxidecomputer/console@15e55044) oxidecomputer/console#2594 * [fa27caf9](oxidecomputer/console@fa27caf9) oxidecomputer/console#2588 * [aad054c5](oxidecomputer/console@aad054c5) oxidecomputer/console#2592 * [d97310be](oxidecomputer/console@d97310be) oxidecomputer/console#2593 * [8ba8a898](oxidecomputer/console@8ba8a898) oxidecomputer/console#2590 * [d7fd3c42](oxidecomputer/console@d7fd3c42) oxidecomputer/console#2586 * [23423c2b](oxidecomputer/console@23423c2b) oxidecomputer/console#2583
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Dec 4, 2024
oxidecomputer/console@059c551...fd47bee * [fd47bee7](oxidecomputer/console@fd47bee7) tweak bump omicron script to prompt for message * [f6a3c06c](oxidecomputer/console@f6a3c06c) bump omicron for project-scoped oxql endpoint * [4d3a923c](oxidecomputer/console@4d3a923c) oxidecomputer/console#2596 * [576e1842](oxidecomputer/console@576e1842) oxidecomputer/console#2595 * [72b6d43d](oxidecomputer/console@72b6d43d) oxidecomputer/console#2579 * [15e55044](oxidecomputer/console@15e55044) oxidecomputer/console#2594 * [fa27caf9](oxidecomputer/console@fa27caf9) oxidecomputer/console#2588 * [aad054c5](oxidecomputer/console@aad054c5) oxidecomputer/console#2592 * [d97310be](oxidecomputer/console@d97310be) oxidecomputer/console#2593 * [8ba8a898](oxidecomputer/console@8ba8a898) oxidecomputer/console#2590 * [d7fd3c42](oxidecomputer/console@d7fd3c42) oxidecomputer/console#2586 * [23423c2b](oxidecomputer/console@23423c2b) oxidecomputer/console#2583
david-crespo
added a commit
that referenced
this pull request
Nov 2, 2026
While looking at #3417, I found that the Link silo and Link pool modals use a click handler to wire up their submit buttons. This means they don't work like forms are supposed to, e.g., pressing Enter doesn't submit the form. In this PR we hook up the submit buttons through `formId`, which makes them the submit button of the `<form>` tag. This matches other modal forms, like instance resize (#2586). On its own this only makes Enter work from the "Make default" checkbox, because the combobox swallows Enter. #3417 (or the alternative I'm about to PR) makes it work from the picker too. While looking at _that_, I asked 🤖 if any other modal forms are hooked up wrong, and it pointed me to the attach floating IP modal in instance create, which _does_ have a `<form>`, but should not because it technically renders inside the instance create form, and you can't have a form inside a form. This caused an actual bug: On Enter, Headless UI's `ListboxButton` submits the nearest form, and React bubbled that submit through the modal portal to the instance create form, so pressing Enter on the closed listbox submits the whole form. Removing the `<form>` fixes it. In this case we have to keep the submit button a click handler. We could add an explicit enter key handler, but it's not worth it.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2585
Modal.Footerhas more lines of props than lines of code. Not my favorite.