Skip to content

selected=None does not work in ui.update_selectize when multiple=False #1074

@ME-researchgroup

Description

@ME-researchgroup

Hi!

I noticed that when I update the inputs for ui.input_selectize using ui.update_selectize the first option will still get selected when providing selected=None.

This issue only occurs when multiple has been set to False in ui.input_selectize. It works as expected when multiple=True.

This works as expected:

# UI
ui.input_selectize(
            "example1",
            "Works as expected",
            choices=[],
            multiple=True,
            selected=None,
        ),

# Server
ui.update_selectize(
                "example1",
                choices=["Option1", "Option2"],
                selected=None,
            )

This will automatically select Option1:

# UI
ui.input_selectize(
            "example2",
            "Unexpected behavior",
            choices=[],
            multiple=False,
            selected=None,
        ),

# Server
ui.update_selectize(
                "example2",
                choices=["Option1", "Option2"],
                selected=None,
            )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions