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
I tryed to reproduce this bug in a clean environment, but without success. This wp site (like many) is a mess of scripts and I really don't know which is the one causing this problem.
I solved my issue adding a variable in 'render' function to control if widget was already rendered, see:
Hi,
First, thank you for this good lib.
I have a problem embedding a widget created with preact-habitat in one Wordpress site. I'm embedding the widget inline, inside a div.
It happens that 'loaded' function (https://github.com/zouhir/preact-habitat/blob/master/src/index.js#L23) is called twice and the last time is called 'window.currentScript' is null so the function 'getExecutedScript' (https://github.com/zouhir/preact-habitat/blob/master/src/lib.js#L20) returns the last script in the page, which is another one different from injection script and the widget is rendered another time at the bottom of the page.
I tryed to reproduce this bug in a clean environment, but without success. This wp site (like many) is a mess of scripts and I really don't know which is the one causing this problem.
I solved my issue adding a variable in 'render' function to control if widget was already rendered, see:
master...farzeni:master
do you have an idea what can be the cause of the problem? or do you think this solution can be merged?
The text was updated successfully, but these errors were encountered: