Skip to content

Commit

Permalink
fix(app): can not input s and /
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Aug 30, 2023
1 parent 245f486 commit de2d935
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/app/src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ const SearchInputKey = 'search:input';
document.addEventListener('keypress', (ev) => {
if (ev.key === 's' || ev.key === '/') {
const input = document.querySelector('#animegarden-search input');
// @ts-ignore
input?.focus();
ev.preventDefault();
ev.stopPropagation();
if (document.activeElement !== input) {
// @ts-ignore
input?.focus();
ev.preventDefault();
ev.stopPropagation();
}
}
});

Expand Down

1 comment on commit de2d935

@Teiiiiiio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.