Results 83 comments of rixo
trafficstars

> So React seems to rely on an algorithm that keeps the active element in the dom always and move the others, so that the focus and selection will be...

@danny-andrews Play it like React? ```js import { beforeUpdate, afterUpdate } from 'svelte' let activeElement beforeUpdate(() => { activeElement = document.activeElement }) afterUpdate(() => { if (activeElement) activeElement.focus() }) ```

I think that should stay open. It's pretty annoying when you run into this (and it can take some time before realizing there's a problem, so you may have built...