From fd757c4aa4138ad7da7f80585e4ae34c9c9631bc Mon Sep 17 00:00:00 2001 From: Diego Medina Date: Wed, 9 Mar 2022 14:27:10 -0500 Subject: [PATCH] fix: enable find text browser functionality inside SQL Lab editor (#19061) --- .../src/SqlLab/components/AceEditorWrapper/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx index 8f8e02d227607..fa373b5242de6 100644 --- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx +++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx @@ -121,6 +121,8 @@ class AceEditorWrapper extends React.PureComponent { } onEditorLoad(editor: any) { + editor.commands.removeCommand('find'); + editor.commands.addCommand({ name: 'runQuery', bindKey: { win: 'Alt-enter', mac: 'Alt-enter' }, @@ -128,6 +130,7 @@ class AceEditorWrapper extends React.PureComponent { this.onAltEnter(); }, }); + this.props.hotkeys.forEach(keyConfig => { editor.commands.addCommand({ name: keyConfig.name, @@ -135,6 +138,7 @@ class AceEditorWrapper extends React.PureComponent { exec: keyConfig.func, }); }); + editor.$blockScrolling = Infinity; // eslint-disable-line no-param-reassign editor.selection.on('changeSelection', () => { const selectedText = editor.getSelectedText();