Skip to content

[Bug]: controller.InputSelectize(...).set only works once with multiple selections #2013

@evanglass

Description

@evanglass

Component

Other

Severity

P1 - High (major feature broken)

Shiny Version

1.4.0

Python Version

3.13.4

Minimal Reproducible Example

############################
## inputselectize_app.py: ##
############################
from shiny import App, ui

app_ui = ui.page_fluid(
    ui.input_selectize("test_selectize", "Select", ["Choice 1", "Choice 2"], multiple=True)
)

def server(input, output, session):
    pass

app = App(app_ui, server)

#############################
## test_inputselectize.py: ##
#############################
from playwright.sync_api import Page
from shiny.playwright import controller
from shiny.pytest import create_app_fixture
from shiny.run import ShinyAppProc

app = create_app_fixture("inputselectize_app.py")

def test_inputselectize(page: Page, app: ShinyAppProc):
    page.goto(app.url)

    controller.InputSelectize(page, "test_selectize").set(["Choice 1"]) # Add Choice 1 to selections
    controller.InputSelectize(page, "test_selectize").set(["Choice 1", "Choice 2"]) # Add Choice 2 to selections
    controller.InputSelectize(page, "test_selectize").set([]) # Clear selections

Behavior

Current:
The test fails when running controller.InputSelectize(page, "test_selectize").set(["Choice 1", "Choice 2"]), presumably due being unable to find the "Choice 1" option in the selectize list, as it is already selected.

Expected:
InputSelectize(...).set

  • Selects any unselected choices which are provided in the argument to set
  • Deselects any selected choices which are not provided in the argument to set

Error Messages (if any)

FAILED test_inputselectize.py::test_inputselectize[chromium] - playwright._impl._errors.TimeoutError: Locator.click: Timeout 30000ms exceeded.

Environment

OS: Windows 11, WSL
Browser: Chromium 137 (via Playwright)
Dependencies (pip freeze):
shiny==1.4.0
pytest-playwright==0.7.0
playwright==1.52.0

anyio==4.9.0
appdirs==1.4.4
asgiref==3.8.1
certifi==2025.4.26
charset-normalizer==3.4.2
click==8.2.1
colorama==0.4.6
greenlet==3.2.3
h11==0.16.0
htmltools==0.6.0
idna==3.10
iniconfig==2.1.0
linkify-it-py==2.0.3
markdown-it-py==3.0.0
mdit-py-plugins==0.4.2
mdurl==0.1.2
narwhals==1.42.1
orjson==3.10.18
packaging==25.0
pluggy==1.6.0
prompt_toolkit==3.0.51
pyee==13.0.0
Pygments==2.19.1
pytest==8.4.0
pytest-base-url==2.1.0
python-multipart==0.0.20
python-slugify==8.0.4
questionary==2.1.0
requests==2.32.4
setuptools==80.9.0
sniffio==1.3.1
starlette==0.47.0
text-unidecode==1.3
typing_extensions==4.14.0
uc-micro-py==1.0.3
urllib3==2.4.0
uvicorn==0.34.3
watchfiles==1.0.5
wcwidth==0.2.13
websockets==15.0.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtestingRelated to testing shiny apps

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions