accept cmd+k for search

pull/853/head
Cory LaViska 2022-08-10 16:28:39 -04:00
rodzic 6fc71601dd
commit ce2abb97e0
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -300,9 +300,12 @@
// Show the search panel slash is pressed outside of a form element
document.addEventListener('keydown', event => {
const isSlash = event.key === '/';
const isCtrlK = (event.metaKey || event.ctrlKey) && event.key === 'k';
if (
!isShowing &&
event.key === '/' &&
(isSlash || isCtrlK) &&
!event.composedPath().some(el => ['input', 'textarea'].includes(el?.tagName?.toLowerCase()))
) {
event.preventDefault();