tjek / tjek-js-sdk

Tjek JavaScript SDK for the browser and Node.js.
18 stars 4 forks source link

Allow inserting Incito into a nested scroll element #217

Closed mortenbo closed 1 year ago

mortenbo commented 1 year ago

I need to insert Incito into a scrollable div where the html tag has overflow: hidden. This PR allows this.

mortenbo commented 1 year ago

@klarstrup Any feedback?

mortenbo commented 1 year ago

We can do that too. The reason for this PR is because if you place Incito inside a div that takes care of overflow instead of body, loading=lazy doesn't work properly. Normally, loading=lazy means it lazy loads ahead of time but in this case, it only loads the images once they enter the viewport (vs. ahead of time).

I really don't want to stop using loading=lazy but this was the best alternative solution.

klarstrup commented 1 year ago

Gotcha!

mortenbo commented 1 year ago

I won't be needing this after all so closing this. Thanks for giving it a looksie though!