-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Labels
Description
update_selectize()
has inconsistent behavior.
When server=True
, there are two remove buttons.
When server=False
there are no remove buttons.
We need to decide what the behavior should be when you specify options
in update_selectize()
.
Should this add additional options to some default list?
Replace the list entirely?
Recommend we:
- We should investigate what the current behavior is in R Shiny.
- Resume investigation of selectInput.ts 289 and how that differs from the preceding code.
The test app here will reproduce both of the mentioned scenarios:
from shiny import App, Inputs, Outputs, Session, module, reactive, ui
@module.ui
def reprex_selectize_ui(label: str):
return ui.input_selectize("x", label, choices=[], multiple=True)
@module.server
def reprex_selectize_server(
input: Inputs, output: Outputs, session: Session, server: bool = True
):
@reactive.effect
def _():
ui.update_selectize(
"x",
choices=[f"Foo {i}" for i in range(3)],
server=server,
options={"placeholder": "Search"},
)
app_ui = ui.page_fluid(
reprex_selectize_ui("serverside", "Server"),
reprex_selectize_ui("clientside", "Client"),
)
def server(input: Inputs, output: Outputs, session: Session):
reprex_selectize_server("serverside", server=True)
reprex_selectize_server("clientside", server=False)
app = App(app_ui, server, debug=True)