posit-dev / posit-dev/py-shiny
Conflict between selectize and card (z-index)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 135
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 21
Description
I've encountered an issue when using ui.input_selectize() within ui.card(). The dropdown menu appears within the card element, rather than an overlay that extends beyond the limits of the card (the behavior exhibited by ui.input_select()). This makes the card scrollable, and it's difficult to select from the dropdown menu. I'm not a CSS expert, but I think this might be related to the z-index property?
Please see the example below, which illustrates the issue:
from shiny import Inputs, Outputs, Session, App, ui
CHOICES = [f"Option {i}" for i in range(10)]
app_ui = ui.page_fluid(
ui.card(
ui.card_header("Helloooo"),
ui.input_select("success", "Dropdown overlays card:", choices=CHOICES),
ui.input_selectize("failure", "Dropdown within card:", choices=CHOICES)
)
)
def server(input: Inputs, output: Outputs, session: Session):
pass
app = App(app_ui, server)
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
Reproduce the example using ui.input_selectize inside ui.card, comparing it with ui.input_select. Inspect the card and selectize styling around the dropdown and the z-index behavior. Done means the selectize menu overlays the card like the regular select and no longer makes the card scrollable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100