Make only search bar keybinds be prevented (#981)

This commit is contained in:
Uriel authored and GitHub committed 2024-04-09 17:38:30 -03:00
1 parent cfd7bc366e
commit bcf66145c2
1 file changed
+9 -3
+9 -3
View File
@@ -162,9 +162,15 @@ export default function App() {
const isTauri = useIsTauri();
useEffect(() => {
const onKeydown: (arg0: KeyboardEvent) => void = function (e) {
// seems to be sufficient to prevent most default shortcuts
e.preventDefault();
const onKeydown: (arg0: KeyboardEvent) => void = function (event) {
// prevent search bar keybind
if (
event.key === 'F3' ||
(event.ctrlKey && event.key === 'f') ||
(event.metaKey && event.key === 'f')
) {
event.preventDefault();
}
};
window.addEventListener('keydown', onKeydown);