Skip to content

fix(ui): stringify selected in update_checkbox_group/update_radio_buttons - #2362

Closed
eeshsaxena wants to merge 2 commits into
posit-dev:mainfrom
eeshsaxena:fix/2272-update-choice-stringify
Closed

fix(ui): stringify selected in update_checkbox_group/update_radio_buttons#2362
eeshsaxena wants to merge 2 commits into
posit-dev:mainfrom
eeshsaxena:fix/2272-update-choice-stringify

Conversation

@eeshsaxena

Copy link
Copy Markdown

Closes #2272.

input_checkbox_group accepts integer choice keys in selected, but update_checkbox_group / update_radio_buttons sent them to the client unchanged, so integer keys never matched the (string) option values on update. Stringify the selected values sent to the client. Adds unit tests (this update path previously had only browser tests).

serialize_frame and the cell-patch scatter path accessed narwhals columns via
data[col_name]. For a numeric column name (e.g. 0) narwhals treats that as
positional row access and returns a row frame, so serialize_dtype received a
DataFrame instead of a Series and raised an obscure AttributeError. Use
get_column(col_name) in both places.
…tons

Choice values render as strings in the DOM, but the update message sent
selected unchanged, so integer choice keys (accepted by
input_checkbox_group) never matched the option values on update. Stringify
the selected values sent to the client.

Closes posit-dev#2272
@cpsievert

Copy link
Copy Markdown
Collaborator

Thanks. Appears this also includes the fix being proposed here? #2358

@eeshsaxena

Copy link
Copy Markdown
Author

You're right, and thanks for spotting it - I branched this off #2358 rather than main, so it carries those commits too. That's my mistake.

Closing this one so #2358 can go in on its own. I'll resend the update_checkbox_group/update_radio_buttons stringify fix separately, branched off main.

@eeshsaxena eeshsaxena closed this Jul 22, 2026
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.

[Bug]: update_checkbox_group requires different selected than input_checkbox_group

2 participants