diff --git a/frontend/components/LiveDocs.js b/frontend/components/LiveDocs.js index ac8a4d997e..db167711cd 100644 --- a/frontend/components/LiveDocs.js +++ b/frontend/components/LiveDocs.js @@ -7,6 +7,7 @@ import { RawHTMLContainer, highlight_julia } from "./CellOutput.js" export let LiveDocs = ({ desired_doc_query, client, on_update_doc_query, notebook }) => { let container_ref = useRef() + let live_doc_search_ref = useRef() let [state, set_state] = useState({ shown_query: null, searched_query: null, @@ -54,12 +55,11 @@ export let LiveDocs = ({ desired_doc_query, client, on_update_doc_query, noteboo } if (state.searched_query !== desired_doc_query) { - fetch_docs() + fetch_docs(desired_doc_query) } - }, [desired_doc_query]) + }, [desired_doc_query, state.hidden]) - let fetch_docs = () => { - const new_query = desired_doc_query + let fetch_docs = (new_query) => { update_state((state) => { state.loading = true state.searched_query = new_query @@ -90,8 +90,33 @@ export let LiveDocs = ({ desired_doc_query, client, on_update_doc_query, noteboo return html`