Skip to content

<Select> does not show the correct initial option if <options> are loaded asynchronously #5051

Closed
@wilcoschoneveld

Description

@wilcoschoneveld

Describe the bug
I have a use case where <select> options are loaded from the backend, but the selected value is loaded earlier. It seems that when the <options> are rendered, the first option is displayed even if another is selected.

Logs
N/A

To Reproduce
https://svelte.dev/repl/9c7fdb3a0a9643839a21287c818a90c7?version=3.23.2

Expected behavior
When loading the repl, the selected value should be BAR according to value = 2

Stacktraces
N/A

Information about your Svelte project:
Svelte version: 3.23.2

Severity
Blocking

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions