mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Merge pull request #15499 from pedrovrima/docs/avoid-modifier-key-input-focus
feat: avoid modifier keys and modifier key bindings to trigger input …
This commit is contained in:
1 file changed
+4
-2
@@ -408,8 +408,10 @@ export function useAutoInputFocus() {
|
||||
|
||||
// Focus the input when typing from anywhere
|
||||
React.useEffect(() => {
|
||||
function onKeyDown() {
|
||||
input?.focus()
|
||||
function onKeyDown(e: KeyboardEvent) {
|
||||
if (!e.ctrlKey && !e.altKey && !e.metaKey && e.key !== 'Tab') {
|
||||
input?.focus()
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('keydown', onKeyDown)
|
||||
|
||||
Reference in new issue
Block a user