Skip to content

tutorial/svelte/actions keeps interrupting typing in the code window #700

@natanmaia95

Description

@natanmaia95

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions