Skip to content

Commit 5f9c450

Browse files
committed
fix(QueryEditor): save query with enter
1 parent 89820ca commit 5f9c450

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ function SaveQuery({savedQueries, onSaveQuery, saveButtonDisabled}) {
4343
};
4444

4545
const onSaveClick = () => {
46-
if (queryName && !validationError) {
47-
onSaveQuery(queryName);
46+
if (!queryName || validationError) {
47+
return;
4848
}
49+
50+
onSaveQuery(queryName);
4951
onCloseDialog();
5052
};
5153

@@ -56,7 +58,13 @@ function SaveQuery({savedQueries, onSaveQuery, saveButtonDisabled}) {
5658

5759
const renderDialog = () => {
5860
return (
59-
<Dialog open={isDialogVisible} hasCloseButton={false} size="s" onClose={onCloseDialog}>
61+
<Dialog
62+
open={isDialogVisible}
63+
hasCloseButton={false}
64+
size="s"
65+
onClose={onCloseDialog}
66+
onEnterKeyDown={onSaveClick}
67+
>
6068
<Dialog.Header caption="Save query" />
6169
<Dialog.Body className={b('dialog-body')}>
6270
{singleClusterMode && (

0 commit comments

Comments
 (0)