diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx index d24c7e9d8..b6af5d8f0 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx @@ -189,6 +189,18 @@ describe('SqlEditor', () => { expect(await findByTestId('react-ace')).toBeInTheDocument(); }); + it('skip rendering an AceEditorWrapper when the current tab is inactive', async () => { + const { findByTestId, queryByTestId } = setup( + { + ...mockedProps, + queryEditor: initialState.sqlLab.queryEditors[1], + }, + store, + ); + expect(await findByTestId('mock-sql-editor-left-bar')).toBeInTheDocument(); + expect(queryByTestId('react-ace')).not.toBeInTheDocument(); + }); + it('avoids rerendering EditorLeftBar and ResultSet while typing', async () => { const { findByTestId } = setup(mockedProps, store); const editor = await findByTestId('react-ace'); diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx index c17ac9324..a0e8ff4f5 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx @@ -880,15 +880,17 @@ const SqlEditor: FC = ({ startQuery={startQuery} /> )} - + {isActive && ( + + )} {renderEditorBottomBar(showEmptyState)}