Is there an afterAppear event for widgets? — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Is there an afterAppear event for widgets?

Summary:

On load triggers on widget initialization. Before appear triggers before the widget template is inserted into the dom.

The causes issues when we need to initialize stuff on the dom of the widget. It works fine on full page loads but once I navigate away and back, beforeAppear triggers before the widget template exists in the dom and so something like document.querySelector(".products") finds nothing.

How can we fix this?

Version (include the version you are using, if applicable):

Storefront Classic v25

Code Snippet (add any code snippets that support your topic, if applicable):

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!