Popover backdrops are a bit tricky in Roll20.
My original attempt was to do <button class="popoverBackdrop">Click me</button>
However, this fails in Roll20
Uncaught TypeError: Cannot read properties of null (reading 'dataset')
at HTMLButtonElement.<anonymous> (vtt.bundle.js:formatted:556749:45)
at HTMLBodyElement.dispatch (jquery-1.9.1.js:3074:9)
at elemData.handle (jquery-1.9.1.js:2750:28)
And looking at the source code:
The error occurs here:
else if ($(this)[0].offsetParent.dataset.reprowid) {
which fails due to offsetParent being undefined.
Buttons in general, appear to need a parent.
Instead, to work around this, I add a parent div, with position: fixed, which solves this issue.
Fix Add clickable popover backdrop #56
Clicking outside of the popover should close it. Also, add a title, spell name, and close button to popover.
https://user-images.githubusercontent.com/5629800/211223423-56f3ae6b-ebef-4b09-a878-117929c43f9d.mp4
Popover backdrops are a bit tricky in Roll20. My original attempt was to do
<button class="popoverBackdrop">Click me</button>
However, this fails in Roll20And looking at the source code: The error occurs here:
else if ($(this)[0].offsetParent.dataset.reprowid) {
which fails due tooffsetParent
being undefined.Buttons in general, appear to need a parent.
Instead, to work around this, I add a parent div, with
position: fixed
, which solves this issue.