ange
ange

Reputation: 11

Popstate event not firing on back button

Script

window.addEventListener('popstate', function (event) {
    console.log(core.current.queryString.k);
    if (!core.current.queryString.k || core.current.queryString.k == "") {
        $(".container").removeClass("some-class");
        $(".container-class").css("height", "");
        $(".container-class").css("bottom", "50px");
        isSearchBarInputted = false;
    }
});

The popstate event is skipped upon hitting the back browser button. It works fine before but I guess the recent updates on Chrome affected this. Are there any ways to remediate this? I'm just starting to get familiar with javascript.

Thanks in advance!

Upvotes: 1

Views: 393

Answers (0)

Related Questions