Closed viniciusteixeiradias closed 1 year ago
Docsearch only support command + k. Adding / is confusing.
Docsearch only support command + k. Adding / is confusing.
@Mister-Hope Confused? What do you mean? The /
works in Docsearch, the problem happens on the first load.
Didn't know that, I will test that later
@Mister-Hope Maybe we need to add this validation below:
const isEditingContent = (e: KeyboardEvent): boolean => {
const element = e.target as HTMLElement;
const tagName = element.tagName;
return (
element.isContentEditable ||
tagName === 'INPUT' ||
tagName === 'SELECT' ||
tagName === 'TEXTAREA'
);
}
I am still awaiting your feedback to keep working on this issue.
Hi there, holiday during April 29th - May 3rd in Chinese, will be back later.
Also didn't know that slash is the default hot key of docsearch. Nice catch!
…alize
Before submitting the PR, please make sure you do the following
close #123
).Solving this problem: https://github.com/vuejs/docs/issues/2240.
What is the purpose of this pull request?
Description
Previously, the
initializate
method was called in onMountedDocsearch.ts
, but there was a change that removed it and the method responsible for triggeringdocsearch
before executing the initializate becameuseDocsearchHotkeyListener
, this method defines akeydown
eventLintener when mounting the component.My change was to add the '/' key to the
useDocsearchHotkeyListener
validation.