Skip to content

Commit ec8d4ae

Browse files
committed
dismiss search on navigate
1 parent f9813b4 commit ec8d4ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/app/view/webview/webview.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ export class WebViewModel implements ViewModel {
298298
handleNavigate(url: string) {
299299
fireAndForget(() => ObjectService.UpdateObjectMeta(WOS.makeORef("block", this.blockId), { url }));
300300
globalStore.set(this.url, url);
301+
if (this.searchAtoms) {
302+
globalStore.set(this.searchAtoms.isOpenAtom, false);
303+
}
301304
}
302305

303306
ensureUrlScheme(url: string, searchTemplate: string) {
@@ -547,7 +550,6 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => {
547550
// Search
548551
const searchProps = useSearch(model.webviewRef, model);
549552
const searchVal = useAtomValue<string>(searchProps.searchAtom);
550-
const isSearchOpen = useAtomValue(searchProps.isOpenAtom);
551553
const setSearchIndex = useSetAtom(searchProps.indexAtom);
552554
const setNumSearchResults = useSetAtom(searchProps.numResultsAtom);
553555
const onSearch = useCallback((search: string) => {

0 commit comments

Comments
 (0)