Skip to content

Conversation

@elnelson575
Copy link
Contributor

Fixes an issue as reported in #1703 where passing options into update_selectize() when server=True breaks the selectize menu (choices do not load, search/filtering does not occur).

Additional problems discovered while addressing this are documented here: #2052

@elnelson575 elnelson575 changed the title Fixes 1703: Fix options selectize not working in modules Fix 1703: Fix options selectize not working in modules Aug 6, 2025
@elnelson575 elnelson575 linked an issue Aug 6, 2025 that may be closed by this pull request
@elnelson575 elnelson575 self-assigned this Aug 6, 2025
@elnelson575 elnelson575 requested a review from cpsievert August 6, 2025 20:50
@cpsievert
Copy link
Collaborator

cpsievert commented Aug 6, 2025

Thanks! Looks good, please update the CHANGELOG and maybe worth a test?

@elnelson575 elnelson575 changed the title Fix 1703: Fix options selectize not working in modules fix 1703: Fix options selectize not working in modules Aug 7, 2025
@elnelson575 elnelson575 changed the title fix 1703: Fix options selectize not working in modules fix: Fix 1703 Options selectize not working in modules Aug 7, 2025
@elnelson575
Copy link
Contributor Author

elnelson575 commented Aug 7, 2025

We're moving this over here and adding a test for it.

Initial fix for overwriting:
move

if options is not None:
        cfg = tags.script(
            json.dumps(options),
            type="application/json",
            data_for=resolve_id(id),
            data_eval=json.dumps(extract_js_keys(options)),
        )
        session.send_input_message(id, {"config": cfg.get_html_string()})

to before

    if not server:
        return update_select(
            id, label=label, choices=choices, selected=selected, session=session
        )

in _input_update.py

@cpsievert cpsievert merged commit 0b9188b into main Aug 8, 2025
65 of 66 checks passed
@cpsievert cpsievert deleted the fix/options-update-selectize branch August 8, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Passing options to update_selectize() inside a module breaks update

3 participants