Skip to content

fix(popover): render dynamic outputs in title-less popover/tooltip#1327

Open
gadenbuie wants to merge 4 commits into
mainfrom
fix/popover-dynamic-content-no-title
Open

fix(popover): render dynamic outputs in title-less popover/tooltip#1327
gadenbuie wants to merge 4 commits into
mainfrom
fix/popover-dynamic-content-no-title

Conversation

@gadenbuie

Copy link
Copy Markdown
Member

For #1326

Dynamically-rendered outputs (e.g. uiOutput()) inside a popover() or tooltip() with no title failed to render — the output stayed stuck "recalculating" and never appeared. (With a title, the same output renders fine.)

Cause

This is an upstream Shiny regression introduced in shiny 1.14.0 (rstudio/shiny#4388). Shiny's IntersectionObserver-based visibility detection ends up targeting bslib's boxless display:contents popover/tooltip wrapper, so it never fires when the popover opens. The output's ResizeObserver is then the only trigger left, and it only fires if the output's box size changes — which, in a title-less popover, it doesn't (the empty output measures 0×0 both before and after opening).

Full root-cause analysis and the proposed Shiny-side fix are tracked in rstudio/shiny#4406.

Fix (temporary workaround)

Add a tiny CSS rule giving shiny outputs inside popovers/tooltips a min-width: 1px, which guarantees a non-zero box so the ResizeObserver fires when the popover opens. Once the output has content it becomes display:contents, so the rule is a no-op — no visual impact.

  • New partial inst/components/scss/tooltip-popover.scss
  • Regenerated inst/components/dist/components.css via tools/compile_component_sass.R
  • NEWS.md entry

This is a workaround pending the upstream Shiny fix (rstudio/shiny#4406); once that ships, this rule can be removed.

gadenbuie and others added 4 commits June 29, 2026 11:16
A dynamically-rendered shiny output (e.g. uiOutput()) inside a popover()
or tooltip() with no title failed to render because shiny's
IntersectionObserver lands on bslib's boxless display:contents wrapper.
Add a temporary min-width:1px rule on shiny outputs inside popovers/tooltips
so the output's ResizeObserver fires. Remove once shiny handles
display:contents wrappers upstream.

Refs #1326
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.

1 participant