Skip to content

Passing options to update_selectize() inside a module breaks update #1703

@thohan88

Description

@thohan88

Based on the update_selectize example from the docs.

When put inside a module, the update logic breaks if options are passed to update_selectize(). No choices are displayed.

from shiny import App, module, reactive, ui

@module.ui
def reprex_selectize_ui():
    return ui.input_selectize("x", "Server side selectize", choices=[], multiple=True)


@module.server
def reprex_selectize_server(input, output, session, starting_value = 0):
    @reactive.effect
    def _():
        ui.update_selectize(
            "x", 
            choices=[f"Foo {i}" for i in range(10000)],
            server=True,
            # options={"placeholder": "Search"},
            # If uncommented, this breaks the update, and no choices are displayed
        )

app_ui = ui.page_fluid(
    reprex_selectize_ui("reprex_selectize")
)


def server(input, output, session):
    reprex_selectize_server("reprex_selectize")


app = App(app_ui, server)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions