fix: hide zoom +/- with the fullscreen button via hide_self - #115
Merged
Conversation
hide_self only toggled the fullscreen button itself; zoom in/out remained visible during fullscreen regardless of hide_self/hide_others. Zoom buttons belong to the fullscreen control itself, so they are now always hidden while fullscreen. The hidden class also needs !important to win over inline display styles set by third-party Leaflet plugins.
- browser: zoom +/- hidden in fullscreen, restored after exit - browser: hide_others overrides inline display set by third-party plugins - rendering: sync classList.toggle assertions with CONST.CLASSES.HIDDEN
hide_self now controls the zoom +/- buttons together with the fullscreen button, so hide_self=false keeps them visible in fullscreen.
Previously zoom +/- were always hidden in fullscreen. Now they follow hide_self together with the fullscreen button, so hide_self=false keeps the whole control visible. Tests updated to cover both hide_self states.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
=======================================
Coverage 97.51% 97.51%
=======================================
Files 11 11
Lines 201 201
Branches 15 15
=======================================
Hits 196 196
Misses 5 5 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates FullscreenControl so that when hide_self is enabled, the zoom +/- buttons are hidden together with the fullscreen toggle while the map is in fullscreen, and strengthens the hiding behavior to override inline display styles.
Changes:
- Hide zoom +/- buttons along with the fullscreen toggle when
hide_self=trueand drive hiding via the shared hidden-class constant. - Update fullscreen state tracking and UI updates to be event-driven (avoid double UI updates in native fullscreen promise callbacks).
- Make the hidden class use
display: none !importantand add rendering/browser tests plus a changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
foliplus/js/FullscreenControl.js |
Adds shared HIDDEN class constant, hides zoom +/- with hide_self, and refactors fullscreen state tracking. |
foliplus/css/FullscreenControl.css |
Ensures hidden controls stay hidden even when sibling controls have inline display styles. |
test/test_FullscreenControl.py |
Updates rendering assertions and adds browser tests validating zoom visibility behavior in fullscreen. |
CHANGELOG.md |
Documents the updated hide_self behavior for FullscreenControl. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Zeroto521
added a commit
that referenced
this pull request
Aug 5, 2026
* fix: hide zoom +/- buttons when entering fullscreen (#114) hide_self only toggled the fullscreen button itself; zoom in/out remained visible during fullscreen regardless of hide_self/hide_others. Zoom buttons belong to the fullscreen control itself, so they are now always hidden while fullscreen. The hidden class also needs !important to win over inline display styles set by third-party Leaflet plugins. * test: cover fullscreen zoom hiding and inline-display override (#114) - browser: zoom +/- hidden in fullscreen, restored after exit - browser: hide_others overrides inline display set by third-party plugins - rendering: sync classList.toggle assertions with CONST.CLASSES.HIDDEN * docs: add FullscreenControl zoom hiding fix to changelog (#114) * docs: correct FullscreenControl zoom hiding changelog entry (#115) hide_self now controls the zoom +/- buttons together with the fullscreen button, so hide_self=false keeps them visible in fullscreen. * fix: hide zoom +/- with the fullscreen button via hide_self (#115) Previously zoom +/- were always hidden in fullscreen. Now they follow hide_self together with the fullscreen button, so hide_self=false keeps the whole control visible. Tests updated to cover both hide_self states. * fix: prevent duplicate fullscreen hint on toggle * fix: use public map.isFullscreen instead of private _isFullscreen * fix: allow exiting pseudo-fullscreen mode toggleFullscreen decided to exit based solely on document.fullscreenElement, which is always null in pseudo-fullscreen mode (native Fullscreen API unavailable). The leaflet-pseudo-fullscreen class could never be removed. The exit branch now also checks the internal map.isFullscreen flag. * test: cover pseudo-fullscreen enter/exit and use real clicks - new browser test: pseudo-fullscreen (native API disabled) can be entered and exited — regression guard for the exit-condition fix - _enter_fullscreen now uses page.click() (real input event) because the Fullscreen API requires user activation; synthesized clicks may reject - _exit_fullscreen keeps a JS click since the toggle is hidden (display:none) while fullscreen and Playwright cannot target it * Update CHANGELOG.md
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.
No description provided.