From e64c8f13b96d5569984c8ef903bc3fbaf9acba1e Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 9 Sep 2024 17:15:37 +0300 Subject: [PATCH] docs: fix shortcut opens search while typing in playground editor (#9831) --- packages/website/src/components/Editor/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/website/src/components/Editor/index.js b/packages/website/src/components/Editor/index.js index 8e8d6fa3fac5..50cd61d240bc 100644 --- a/packages/website/src/components/Editor/index.js +++ b/packages/website/src/components/Editor/index.js @@ -301,6 +301,13 @@ ${fixAssetPaths(_js)}`, tabBarRef.current.project = projectRef.current; fileEditorRef.current.project = projectRef.current; previewRef.current.project = projectRef.current; + + // algolia search opens the search on key `/` because this custom element is the event target but has no `isContentEditable` + Object.defineProperty(fileEditorRef.current, "isContentEditable", { + get() { + return true; + }, + }); tabBarRef.current.editor = fileEditorRef.current;