diff --git a/src/renderer/components/DestructiveConfirmModal.tsx b/src/renderer/components/DestructiveConfirmModal.tsx index 74af93a2..8b6156e1 100644 --- a/src/renderer/components/DestructiveConfirmModal.tsx +++ b/src/renderer/components/DestructiveConfirmModal.tsx @@ -36,6 +36,7 @@ export default function DestructiveConfirmationModal(props: Props) { modalHeaderText={title} handleCancel={onCancel} handleConfirm={onAccept} + handleEnterKeyPress={onAccept} confirmButtonText={acceptLabel} cancelButtonText={cancelLabel} confirmButtonClassName='btn-danger' diff --git a/src/renderer/components/Modal.tsx b/src/renderer/components/Modal.tsx index da7928ae..a7eb0714 100644 --- a/src/renderer/components/Modal.tsx +++ b/src/renderer/components/Modal.tsx @@ -124,7 +124,7 @@ export const Modal: React.FC = ({ const handleConfirmClick = async (event: React.MouseEvent) => { event.preventDefault(); - if (autoCloseOnConfirmButton) { + if (autoCloseOnConfirmButton && !isConfirmDisabled) { await onHide(); } handleConfirm?.(); @@ -135,7 +135,7 @@ export const Modal: React.FC = ({ if (event.nativeEvent.isComposing) { return; } - if (autoCloseOnConfirmButton) { + if (autoCloseOnConfirmButton && !isConfirmDisabled) { await onHide(); } if (handleEnterKeyPress) { diff --git a/src/renderer/components/NewServerModal.tsx b/src/renderer/components/NewServerModal.tsx index d17f9948..29bf709e 100644 --- a/src/renderer/components/NewServerModal.tsx +++ b/src/renderer/components/NewServerModal.tsx @@ -361,6 +361,7 @@ class NewServerModal extends React.PureComponent { onExited={this.props.unremoveable ? () => {} : this.props.onClose} modalHeaderText={this.getModalTitle()} confirmButtonText={this.getSaveButtonLabel()} + handleEnterKeyPress={this.save} handleConfirm={this.save} isConfirmDisabled={!this.state.serverName.length || !this.state.validationResult || this.isServerURLErrored()} handleCancel={this.props.onClose} diff --git a/src/renderer/components/SettingsModal/index.tsx b/src/renderer/components/SettingsModal/index.tsx index d5fd6963..e7afded1 100644 --- a/src/renderer/components/SettingsModal/index.tsx +++ b/src/renderer/components/SettingsModal/index.tsx @@ -156,6 +156,7 @@ export default function SettingsModal({ defaultMessage='Desktop App Settings' /> } + autoCloseOnConfirmButton={false} headerContent={savingText} bodyDivider={true} bodyPadding={false} diff --git a/src/renderer/components/showCertificateModal.tsx b/src/renderer/components/showCertificateModal.tsx index 66c90b8a..1284a395 100644 --- a/src/renderer/components/showCertificateModal.tsx +++ b/src/renderer/components/showCertificateModal.tsx @@ -79,6 +79,7 @@ export default class ShowCertificateModal extends React.PureComponent } handleConfirm={this.handleOk} + handleEnterKeyPress={this.handleOk} >
{certificateSection( diff --git a/src/renderer/modals/login/loginModal.tsx b/src/renderer/modals/login/loginModal.tsx index 68105b61..5abea032 100644 --- a/src/renderer/modals/login/loginModal.tsx +++ b/src/renderer/modals/login/loginModal.tsx @@ -110,6 +110,7 @@ class LoginModal extends React.PureComponent { /> } handleConfirm={this.handleSubmit} + handleEnterKeyPress={this.handleSubmit} confirmButtonText={ { onExited={() => {}} modalHeaderText={this.getModalTitle()} handleConfirm={this.props.handleGrant} + handleEnterKeyPress={this.props.handleGrant} confirmButtonText={