Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thohan88 opened this issue Sep 25, 2024 · 0 comments
Open

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

thohan88 opened this issue Sep 25, 2024 · 0 comments

Comments

@thohan88
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant