You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading blinx on a page with only static text, it works great.
But sometimes we show verses in areas that are rendered dynamically. Think of accordions, dialogs, sidebars, etc. This content is likely not in the DOM until the user interacts.
In such a case, it is possible to re-trigger blinx by calling await window.blinx?.execute(). However, this will not only match new elements but also existing elements that already have a tippy attached. In consequence, blinx will attach a second, third, fourth, etc. tippy each time it is called.
To work around this, we need to jump through some hoops, e.g. we can remove data-osis attributes before calling execute() and then add them back afterward. But this is cumbersome, brittle, and unnecessarily slow.
An easy way to fix this in the library would be to select on "[data-osis]:not([data-tippy])" instead of "[data-osis]"here.
The text was updated successfully, but these errors were encountered:
n4bb12
changed the title
Support finding verses in dynamic content
Better support for dynamic content
Oct 1, 2023
When loading blinx on a page with only static text, it works great.
But sometimes we show verses in areas that are rendered dynamically. Think of accordions, dialogs, sidebars, etc. This content is likely not in the DOM until the user interacts.
In such a case, it is possible to re-trigger blinx by calling
await window.blinx?.execute()
. However, this will not only match new elements but also existing elements that already have a tippy attached. In consequence, blinx will attach a second, third, fourth, etc. tippy each time it is called.To work around this, we need to jump through some hoops, e.g. we can remove
data-osis
attributes before callingexecute()
and then add them back afterward. But this is cumbersome, brittle, and unnecessarily slow.An easy way to fix this in the library would be to select on
"[data-osis]:not([data-tippy])"
instead of"[data-osis]"
here.The text was updated successfully, but these errors were encountered: