posit-dev / posit-dev/py-shiny

Tooltip inside popover doesn't work, throws error

Open
#1,209 0 comments 0 reactions 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

When a tooltip is placed inside a popover element, a console error is thrown when the popover is displayed, and the tooltip doesn't show when hovering over the popover:

from shiny import App, ui

app_ui = ui.page_fluid(
    ui.popover(
        ui.input_action_button("btn", "A button", class_="mt-3"),
        ui.tooltip("A popover", "A tooltip"),
        id="btn_popover",
    ),
)

app = App(app_ui, server=None)
Uncaught TypeError: e is null
    connectedCallback tooltip.ts:90
    show tooltip.js:210
    _enter tooltip.js:509
    setTimeout handler*_setTimeout tooltip.js:530
    _enter tooltip.js:507
    toggle tooltip.js:167
    _setListeners tooltip.js:450
    i event-handler.js:98

Is there a fix or a workaround? I need to be able to show help information for my pop-up controls.

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 issue with the provided Python app and inspect the tooltip.ts and tooltip.js frames named in the console trace, starting at connectedCallback. Done means displaying the popover causes no TypeError and the tooltip appears when hovering over the popover.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.