Skip to content

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

Revert "Hide cursor in the readonly native editor (#63774)" (#66727)

Riley Thompsonc9969b6552ed
diff --git a/e2e/test/scenarios/actions/model-actions.cy.spec.js b/e2e/test/scenarios/actions/model-actions.cy.spec.js
index 0ab5c766c98..e34191f5ebf 100644
--- a/e2e/test/scenarios/actions/model-actions.cy.spec.js
+++ b/e2e/test/scenarios/actions/model-actions.cy.spec.js
@@ -812,7 +812,10 @@ function openActionEditorFor(actionName, { isReadOnly = false } = {}) {
}
function assertQueryEditorDisabled() {
- H.NativeEditor.get().should("have.attr", "contenteditable", "false");
+ // Ace doesn't act as a normal input, so we can't use `should("be.disabled")`
+ // Instead we'd assert that a user can't type in the editor
+ H.fillActionQuery("QWERTY");
+ cy.findByText("QWERTY").should("not.exist");
}
function enableSharingFor(actionName, { publicUrlAlias }) {
diff --git a/frontend/src/metabase/common/components/CodeMirror/CodeMirror.tsx b/frontend/src/metabase/common/components/CodeMirror/CodeMirror.tsx
index 4f08a0c7ef1..53e1b7dc690 100644
--- a/frontend/src/metabase/common/components/CodeMirror/CodeMirror.tsx
+++ b/frontend/src/metabase/common/components/CodeMirror/CodeMirror.tsx
@@ -28,7 +28,6 @@ export const CodeMirror = forwardRef(function CodeMirrorInner(
autoCorrect,
tabIndex,
extensions,
- readOnly,
...rest
} = props;
@@ -54,8 +53,6 @@ export const CodeMirror = forwardRef(function CodeMirrorInner(
className={cx(S.editor, className)}
basicSetup={setup}
extensions={extendedExtensions}
- readOnly={readOnly}
- editable={!readOnly}
/>
);
});