fix: correct fullscreen lifecycle on comparison maps - #118
Merged
vbhjckfd merged 1 commit intoAug 24, 2026
Merged
Conversation
Collapsing a similar-route entry while its map was fullscreen left the browser stranded in fullscreen on a torn-down element. Reopen/close cycles also stacked one fullscreenchange listener per rebuild, each closing over an already-removed map. - cmpDrop exits fullscreen before map.remove() - addFullscreenControl binds the listener once per div and resolves the live map through the _cmpMaps registry instead of a stale closure
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.
Summary
cmpDropcalledmap.remove()with no check fordocument.fullscreenElement).fullscreenchangelistener per rebuild on the same div, each closing over an already-remove()-d map instance.Fix
cmpDrop: exit fullscreen before removing the map if the map's container is currently fullscreen.addFullscreenControl: bind the listener once per div (_fsBoundguard), and resolve the live map through the_cmpMapsregistry by key at fire time instead of a closed-overm.Route-detail maps (last column) are unaffected — they're built once and never rebuilt, so neither bug applies there.
Based on #117 (comparison-map feature) — targets that branch, not master.
Test plan
npx vitest run tests/actions/getAllRoutesAction.test.js(6 passed)npx vitest runfull suite (212 passed)<script>still parses standalone<details>without exiting fullscreen first — page should return to normalfullscreenchangelistener is attached (devtoolsgetEventListeners)