[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix modal close return focus

Kasper (May 23, 2025, 2:20 PM +0200) fbcc5a83 54040e0a

+7
+7
src/components/Modal.svelte
··· 16 16 export let title: string | null = null 17 17 let dialog_el: HTMLDialogElement 18 18 19 + let last_focused_el: Element | undefined | null 20 + 19 21 $modal_count += 1 20 22 onDestroy(() => { 21 23 $modal_count -= 1 22 24 dialog_el.close() 25 + if (last_focused_el instanceof HTMLElement) { 26 + // For some reason necessary with Svelte 5, maybe onDestroy runs too early 27 + last_focused_el?.focus() 28 + } 23 29 }) 24 30 25 31 onMount(() => { 32 + last_focused_el = document.activeElement 26 33 dialog_el.showModal() 27 34 }) 28 35