Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

remove focus event handling on the canvas

Oleg Isonen8f04922f767d
diff --git a/app/canvas/shared/use-track-selected-element.ts b/app/canvas/shared/use-track-selected-element.ts
index ab3a6b285c..04afb54aab 100644
--- a/app/canvas/shared/use-track-selected-element.ts
+++ b/app/canvas/shared/use-track-selected-element.ts
@@ -41,12 +41,6 @@ export const useTrackSelectedElement = () => {
useSubscribe("selectElement", focusAndSelect);
useEffect(() => {
- const handleFocus = () => {
- select(document.activeElement);
- };
-
- window.addEventListener("focus", handleFocus, eventOptions);
-
const handleClick = (event: MouseEvent) => {
// Notify in general that document was clicked
// e.g. to hide the side panel
@@ -56,7 +50,6 @@ export const useTrackSelectedElement = () => {
window.addEventListener("click", handleClick, eventOptions);
return () => {
- window.removeEventListener("focus", handleFocus);
window.removeEventListener("click", handleClick);
};
}, [select]);