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
Describe the bug
When the top banner is used, it takes a moment to display when pages are loaded. This can cause the page to shift once the banner is shown.
To Reproduce
Steps to reproduce the behavior:
Set up an active sale with a "custom" banner shown at the top of the site. Long "banner text" makes it easier to see this issue.
Visit the frontend of the website and see that the banner does not load immediately.
Cause
Custom Banners are initially set to be hidden here:
This hide/show behavior was added by this commit where the goal was to allow users to dismiss banners either "per page load" or "per session": 92132c9
Expected behavior
Ideally, there would not be a page shift regardless of whether banners are set to dismiss "per page load" or "per session".
With that being said, the easiest solution is to just fix this page shift issue when "per page load" is selected. In this case, the JS to hide/show the banner is not needed, and the banner can always just be displayed immediately.
Isolating the problem (mark completed items with an [x]):
I have deactivated other plugins and confirmed this bug occurs when only the Sitewide Sales and relevant module plugins are active.
This bug happens with a default WordPress theme active, or Memberlite.
I can reproduce this bug consistently using the steps above.
WordPress Environment
```
Please share non-sensitive information about your hosting environment such as WordPress version, PHP version, Sitewide Sales, and any related plugins versions.
```
The text was updated successfully, but these errors were encountered:
Describe the bug
When the top banner is used, it takes a moment to display when pages are loaded. This can cause the page to shift once the banner is shown.
To Reproduce
Steps to reproduce the behavior:
Cause
Custom Banners are initially set to be hidden here:
sitewide-sales/modules/banner/swsales/class-swsales-banner-module-swsales.php
Line 167 in b49d757
And then JS shows the banner here if it hasn’t yet been dismissed:
sitewide-sales/js/swsales.js
Line 99 in b49d757
This hide/show behavior was added by this commit where the goal was to allow users to dismiss banners either "per page load" or "per session":
92132c9
Expected behavior
Ideally, there would not be a page shift regardless of whether banners are set to dismiss "per page load" or "per session".
With that being said, the easiest solution is to just fix this page shift issue when "per page load" is selected. In this case, the JS to hide/show the banner is not needed, and the banner can always just be displayed immediately.
Isolating the problem (mark completed items with an [x]):
WordPress Environment
The text was updated successfully, but these errors were encountered: