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
The Give plugin includes some JavaScript that is meant to clear a donation form if you fill out a form and then use the “Back” button in your browser to go back to a page with the form. That’s great, but the problem is that it tries to clear the data on every page, not just on pages with a donation form, so if you go back to a page without a form, you get an error: TypeError: e(...).find(...)[0] is undefined
The problem is in assets/js/frontend/give.js, line 108.
Expected Behavior
I expect to be able to navigate back on pages that do NOT have a Give form and not encounter a JS error on them.
Possible Solution
Detect if the page has a Give form and only target the Give form pages if they are present. Optionally, only enqueue our Give JS on pages where a Give form exists.
Steps to Reproduce
Go to a page on your site that does NOT have a Give form.
Navigate to another page on your site that also does not have A Give form.
User Story
As a Give user, I want to be able to navigate through my site without any JS errors.
Current Behavior
As reported here:
https://wordpress.org/support/topic/js-errors-when-you-hit-the-back-button/#post-10211556
Expected Behavior
I expect to be able to navigate back on pages that do NOT have a Give form and not encounter a JS error on them.
Possible Solution
Detect if the page has a Give form and only target the Give form pages if they are present. Optionally, only enqueue our Give JS on pages where a Give form exists.
Steps to Reproduce
Related
The text was updated successfully, but these errors were encountered: