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 irritating Enter key behaviour in container creation dialog #1861

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

martinpitt
Copy link
Member

Pressing "Enter" in the dialog on any active form element (such as the search input or the checkboxes) previously bubbled up to the Form, which then activated the first popover help. This is unexpected and very irritating especially when using the search input.

Just ignore the Enter key to fix that, similar to what the image search modal already does.

See #1821 (comment)

src/ImageRunModal.jsx Outdated Show resolved Hide resolved
mvollmer
mvollmer previously approved these changes Sep 26, 2024
@@ -744,7 +744,7 @@ export class ImageRunModal extends React.Component {
);

const defaultBody = (
<Form>
<Form onKeyDown={e => e.key === 'Enter' && e.preventDefault()}>
Copy link
Member

@mvollmer mvollmer Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this calls for a comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! Right, it's better as a comment than only just in the commit message. Added.

Pressing "Enter" in the dialog on any active form element (such as the
search input or the checkboxes) previously bubbled up to the Form, which
then activated the first popover help. This is unexpected and very
irritating especially when using the search input.

Just ignore the Enter key to fix that, similar to what the image search
modal already does.

See cockpit-project#1821 (comment)
@mvollmer mvollmer merged commit 0829c3c into cockpit-project:main Sep 27, 2024
34 checks passed
@martinpitt martinpitt deleted the select-enter branch September 27, 2024 08:39
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.

3 participants