Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

GDGT-2365 fix z-index in PythonEditor (#75052)

Egor Grushin5efc5f7963d8
diff --git a/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts b/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts
index 4959f4f8c6e..3ee1edc45db 100644
--- a/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts
+++ b/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts
@@ -195,7 +195,23 @@ describe("scenarios > admin > transforms", { tags: ["@external"] }, () => {
cy.log("Select database");
H.popover().findByText(DB_NAME).click();
+ cy.log("open the editor search panel with Cmd/Ctrl+F (metabase#73290)");
+ H.PythonEditor.focus();
+ cy.realPress([H.metaKey, "f"]);
+ cy.findByTestId("python-editor")
+ .find(".cm-panels")
+ .should("be.visible");
+
getPythonDataPicker().findByText("Select a table…").click();
+
+ cy.log(
+ "the editor search panel must not paint over the modal (metabase#73290)",
+ );
+ H.entityPickerModal().should("be.visible");
+ cy.findByTestId("python-editor")
+ .find(".cm-panels")
+ .should("not.be.visible");
+
H.entityPickerModal().findByText("Animals").click();
getPythonDataPicker().within(() => {
diff --git a/frontend/src/metabase/common/components/CodeMirror/CodeMirror.module.css b/frontend/src/metabase/common/components/CodeMirror/CodeMirror.module.css
index c6182630bf0..e70a874faad 100644
--- a/frontend/src/metabase/common/components/CodeMirror/CodeMirror.module.css
+++ b/frontend/src/metabase/common/components/CodeMirror/CodeMirror.module.css
@@ -14,6 +14,13 @@
outline: none;
}
+ /* CodeMirror's search panel defaults to z-index 300, which leaks out of the
+ editor and renders over surrounding components and modals. Drop it so the
+ panel only stacks above the editor's own content. (metabase#73290) */
+ .cm-panels {
+ z-index: 2;
+ }
+
.cm-content {
color: var(--mb-color-text-primary);
background: none;