Open Mister-Hope opened 2 years ago
Hi, any update with this one? Can we add a detroy method to clear docsearch event listener and destory the dom?
Hello?
(Hey there, sorry for the delay, added context here https://github.com/algolia/docsearch/issues/1734)
If you feel like contributing/providing the method, I'd be more than happy to review it!
Sure, I will try to build a destory
method if possible.
I just want to make sure if this sounds ok to you before starting contribution.
Hi, any update about this one? I am still meeting users reporting this frequently.
I opened PR years ago https://github.com/algolia/docsearch/pull/1742, while I am not getting any review.
@shortcuts @francoischalifour
Hi, this is Mr.Hope from VuePress Team.
Docsearch is not providing a method to destory itself or any way to customize (or remove) the search key listener in docs. So I wonder if there is a way, otherwise this will trigger error in SPA application, as each initialization will have side effects which can not be cleared.
Visit https://mister-hope.com/ and scroll down then click the first article. When you click
Ctrl + K
, you will find 2 docsearch popup is displayed.In VuePress, we are using SPA and provide "layout" options, different page may choose different layout. So when you switch to the first article, the whole page is rerendered because they have different layout, so docsearch reinitializes. But the previous key listener seems still exist, so keyboard actions seems not correct.