Repository navigation
Close all menus when tapping outside the mobile menu sheet - #144
Merged
Merged
Conversation
Tapping the scrim only closed the top menu, so from a submenu it went back one level instead of dismissing the sheet. Add MenuScope.closeAllMenus() and use it for the scrim; Back and the back arrow still close one level. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…tTest Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
MattiasBuelens
force-pushed
the
feature/close-all-menus
branch
from
October 22, 2026 14:53
91d5dc0 to
9bb676d
Compare
Merged
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
MenuScope.closeAllMenus()closes all open menus at once.UIControllerScopeImplempties its menu stack, so the existing cleanup drops the closed menus' saved state. With no menus open, it does nothing.MenuScoperequires an opt-in to implement, so adding a member doesn't affect apps.closeAllMenus()instead ofcloseCurrentMenu(). From a submenu, it used to go back one level instead of closing the sheet. Back and the back arrow still go back one level. TheMenuKDocs say tapping outside "closes all open menus".closeAllMenus()and the new tap-outside behavior.Test plan
./gradlew ktfmtCheck :ui-common:testDebugUnitTest :ui:testDebugUnitTest :ui-tv:testDebugUnitTest :app:assembleLatestPlayerDebugUIControllerScopeImplTest:closeAllMenus()with three open menus leaves no current menu and no menu IDs, and marks the last change as a close; with no open menus it does nothing;closeCurrentMenu()only closes the top menuMenuSheetTestcases with a realUIController: tapping outside from a submenu closes the whole sheet; Back from a submenu returns to the parent menuGenerated with Devin