posit-dev / posit-dev/py-shiny

Conflict between selectize and card (z-index)

Open
#779 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
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)
image image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.