Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for dynamic content #110

Open
n4bb12 opened this issue Oct 1, 2023 · 0 comments
Open

Better support for dynamic content #110

n4bb12 opened this issue Oct 1, 2023 · 0 comments

Comments

@n4bb12
Copy link

n4bb12 commented 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 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.

@n4bb12 n4bb12 changed the title Support finding verses in dynamic content Better support for dynamic content Oct 1, 2023
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

No branches or pull requests

1 participant