Skip to content

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

Merged
gadenbuie merged 8 commits into
mainfrom
fix/popover-dynamic-content-no-title
Aug 3, 2026
Merged

fix(popover): render dynamic outputs in title-less popover/tooltip#1327
gadenbuie merged 8 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
@gadenbuie

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in c19864e. The two conflicts were:

  • R/sysdata.rda (binary): used origin/main's version — our PR made no data changes, so main's version (which includes the offcanvas feature data) is correct.
  • inst/components/dist/components.css (generated): used origin/main's version as the base and appended our :is(.popover, .tooltip) .shiny-html-output{min-width:1px} rule; NEWS.md auto-merged cleanly.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@gadenbuie
gadenbuie requested a review from cpsievert August 3, 2026 18:14
@gadenbuie
gadenbuie merged commit ae77ae4 into main Aug 3, 2026
12 checks passed
@gadenbuie
gadenbuie deleted the fix/popover-dynamic-content-no-title branch August 3, 2026 19:40
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.

4 participants