Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: emoji popover in markdown (#2610)

Myles Scolnickc0016a12b692
diff --git a/frontend/src/components/editor/Cell.tsx b/frontend/src/components/editor/Cell.tsx
index af32fc79cd..3a4647f30c 100644
--- a/frontend/src/components/editor/Cell.tsx
+++ b/frontend/src/components/editor/Cell.tsx
@@ -53,6 +53,7 @@ import { MoreHorizontalIcon } from "lucide-react";
import { Toolbar, ToolbarItem } from "@/components/editor/cell/toolbar";
import { cn } from "@/utils/cn";
import { isErrorMime } from "@/core/mime";
+import { getCurrentLanguageAdapter } from "@/core/codemirror/language/commands";
/**
* Imperative interface of the cell.
@@ -210,8 +211,13 @@ const CellComponent = (
//
// Returns the code to run.
const prepareToRunEffects = useCallback(() => {
- const code = getEditorCodeAsPython(derefNotNull(editorView));
- closeCompletion(derefNotNull(editorView));
+ const ev = derefNotNull(editorView);
+ const code = getEditorCodeAsPython(ev);
+ // Skip close on markdown, since we autorun, otherwise we'll close the
+ // completion each time.
+ if (getCurrentLanguageAdapter(ev) !== "markdown") {
+ closeCompletion(ev);
+ }
prepareForRun({ cellId });
return code;
}, [cellId, editorView, prepareForRun]);