fix(docs): ensure downstream libraries can use HintWidget

Problem

HintWidget works correctly on all existing dashboard pages, where it is injected via Jinja2 templates directly into the main page DOM. However, for Plotmon generated such as Plotmon nothing happens when hovering over the ? circle. The widget renders correctly and the event handlers are present in the HTML, but the popup never appears.

The hover handler uses document.getElementById('hint-modal-...') to find the popup element. Hypothesis is that Bokeh renders Div content inside a shadow DOM, isolated from the main document — so document.getElementById returns null.

Proposed fix

Replace document.getElementById with this.getRootNode().getElementById. getRootNode() returns the shadow root when called from inside a shadow DOM, and the document otherwise.

Open to alternatives if the diagnosis or solution turns out to be wrong. Just opening this MR to get input.

Edited by Dianto Bosman

Merge request reports

Loading
Loading