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

YTPOS-124 re-initialize widgets on ajax call #24

Open
wants to merge 3 commits into
base: release/21.6.1
Choose a base branch
from

Conversation

WarriorAchilles
Copy link
Collaborator

Once the ajax request is complete, wait 1 millisecond so rendering is finished before re-initializing the widgets.

@@ -7,7 +7,8 @@
this.addEventListener('load', function(c) {
// this event listener will hit every time an ajax request is made, so filter out
// requests so we only re-init the widgets when the request is for PLP search refinements
if (c.currentTarget.responseURL.includes('Search-ShowAjax')) {
var urlObj = new URL(c.currentTarget.responseURL)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine as we should always have a responseURL. Otherwise, newing-up a URL via a URL(null) or URL(undefined) yields an error.

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

Successfully merging this pull request may close these issues.

2 participants