sveltekit-i18n/lib

Default locale flashes when reloading page

MvRemmerden opened this issue · 3 comments

When I reload the multi-page example on Netlify, the dropdown menu for selecting the locale flashes the default value.

I'm having the same problem when developing locally, and while the normal translated text is displayed perfectly fine without flashing, I couldn't figure out how to remove the flashing for the locale.

Kapture 2023-10-03 at 21 07 45

Hi @MvRemmerden!
I’m not 100% sure, but I think this one is about browser’s behavior - how it deals with preselected options in select component. For instance, I see no glitches in Safari on iOS.

IMG_0329.MOV

Actually you could use selected option attribute (e.g. selected="{$locale === value}") to get rid of this behavior.. it seems that bind:value does not handle it by default..

Fixed in the example