Skip to content

Commit f532b4b

Browse files
authored
Remove selecting first element on load (onlook-dev#1731)
1 parent c485067 commit f532b4b

File tree

1 file changed

+0
-13
lines changed
  • apps/studio/src/routes/editor/WebviewArea

1 file changed

+0
-13
lines changed

apps/studio/src/routes/editor/WebviewArea/Frame.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ const Frame = observer(
9797
const state = editorEngine.webviews.computeState(body);
9898
editorEngine.webviews.setState(webview, state);
9999

100-
if (state === WebviewState.DOM_ONLOOK_ENABLED) {
101-
setTimeout(() => {
102-
selectFirstElement(webview);
103-
}, 1000);
104-
}
105-
106100
setTimeout(() => {
107101
getDarkMode(webview);
108102
}, 100);
@@ -384,13 +378,6 @@ const Frame = observer(
384378
);
385379
}
386380

387-
async function selectFirstElement(webview: Electron.WebviewTag) {
388-
const domEl = await webview.executeJavaScript(`window.api?.getFirstOnlookElement()`);
389-
if (domEl) {
390-
editorEngine.elements.click([domEl], webview);
391-
}
392-
}
393-
394381
return (
395382
<div
396383
className="flex flex-col fixed"

0 commit comments

Comments
 (0)