fix: Mobile banner close button dismisses the wrong banner and leaves a ghost element - #13270
Closed
reddam-charan-teja-reddy wants to merge 4 commits into
Closed
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
On mobile, the survey/donation banner (
donate_banner.tt.html) and the app-download banner (site_layout.tt.html) share the same screen space. When a user dismisses the survey banner, two problems occur:display: nonebut its absolutely-positioned close button remains visible and clickable in the DOM, overlapping the app-download banner.Root cause: A premature
</section>tag indonate_banner.tt.htmlplaced the close button outside its parent section, anddisplay: noneon the parent didn't affect it. The app-download banner also had no close button of its own.Changes:
donate_banner.tt.htmlsite_layout.tt.htmlscss/_off.scssReplaces
bannerID.style.display = 'none'withbannerID.remove()so dismissed banners are fully removed from the DOMAdds a close button with cookie-based persistence to the mobile app-download banner in
site_layout.tt.html, with supporting styles in_off.scssLarge Language Models usage disclosure
Used GitHub Copilot (Claude Opus 4.6), for investigating the root cause, and implementing the fix.
All changes were tested locally on
http://world.openfoodfacts.localhost/in mobile view.Screenshot or video
Before: Not possible to dismiss the banner
After: Both the banners can be dismissed with their respective close button
After closing
Related issue(s) and discussion