Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key listener issues in SPA #1363

Open
Mister-Hope opened this issue Apr 16, 2022 · 5 comments
Open

Key listener issues in SPA #1363

Mister-Hope opened this issue Apr 16, 2022 · 5 comments

Comments

@Mister-Hope
Copy link

Mister-Hope commented Apr 16, 2022

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.

@Mister-Hope
Copy link
Author

Hi, any update with this one? Can we add a detroy method to clear docsearch event listener and destory the dom?

@Mister-Hope
Copy link
Author

Hello?

@Mister-Hope Mister-Hope changed the title Key listenter setting and issues in SPA Key listener issues in SPA Dec 27, 2022
@shortcuts
Copy link
Member

shortcuts commented Dec 27, 2022

(Hey there, sorry for the delay, added context here #1734)

If you feel like contributing/providing the method, I'd be more than happy to review it!

@Mister-Hope
Copy link
Author

Mister-Hope commented Dec 27, 2022

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.

Mister-Hope added a commit to Mister-Hope/docsearch that referenced this issue Dec 31, 2022
@Mister-Hope
Copy link
Author

Mister-Hope commented Mar 5, 2024

Hi, any update about this one? I am still meeting users reporting this frequently.

I opened PR years ago #1742, while I am not getting any review.

@shortcuts @francoischalifour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants