-
-
Notifications
You must be signed in to change notification settings - Fork 188
Closed
Labels
Description
https://svelte.dev/tutorial/svelte/actions
The prompt of the tutorial is to add a "grab focus" kind of element to a menu.
Problem is, every few characters you type the preview refreshes and the menu takes the focus away from the code window,
without feedback, interrupting your typing. There's a lot to type as well so you keep having to move your mouse back to the code window to type 4-7 letters at a time.
The problem starts appearing in my session while typing:
$effect(() => {
focusable()[0]?.focus();
>>>node.addEventListener('keydown', handleKeydown);<<< this line
});
It usually happens when typing 'keydown'. The preview keeps refreshing and stealing focus from the code window and preventing me to type.
I'm not familiar with this refreshing preview thing so I don't have proposed solutions.
spacepumpkin