posit-dev / posit-dev/py-shiny
bug(ui): All closed panels for `ui.accordion(multiple=True)`'s input value should be `()`, not `None`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 135
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 21
Description
A possible side-effect is that, if
restore_inputreturns None, now the first panel will be open. (Old behavior was that all panels would be closed.) It's unclear whetherrestore_inputwould ever return None or what the expected behavior should be.When all panels are closed on a
multiple=Trueaccordion, currently, the shiny input value isNone.Proposal:
- When all panels are closed, the input value should be an empty tuple
(). (**asking team IRL if this is a good idea)- or When all panels are closed, the value stays as
None, but you'll need to restore therestore_inputlogic as it will restore aNonevalue.
Originally posted by @schloerke in https://github.com/posit-dev/py-shiny/issues/2112#issuecomment-3492050667
Requires: https://github.com/rstudio/bslib/issues/1252
Using a shiny input handler (or different input value being sent from browser), we should use an empty tuple, and not None. This will help distinguish between empty and missing value.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ui.accordion(multiple=True) input handling and the restore_input behavior described in the issue, then review the linked bslib issue 1252. Done means choosing and implementing the agreed behavior for an accordion with all panels closed, with the input represented consistently as either () or None.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100