From e34f08ecb5764e8016a8bdf313fa457318133257 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 26 Sep 2024 10:15:47 +0200 Subject: [PATCH] Fix irritating Enter key behaviour in container creation dialog 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 https://github.com/cockpit-project/cockpit-podman/pull/1821#issuecomment-2374302608 --- src/ImageRunModal.jsx | 2 +- test/check-application | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ImageRunModal.jsx b/src/ImageRunModal.jsx index e6806de3e..94d835176 100644 --- a/src/ImageRunModal.jsx +++ b/src/ImageRunModal.jsx @@ -744,7 +744,7 @@ export class ImageRunModal extends React.Component { ); const defaultBody = ( -
+ e.key === 'Enter' && e.preventDefault()}> {this.state.dialogError && }