Skip to content

Commit bdd44bb

Browse files
Recreate and render bottom sheet at every launch to avoid unexpected state (#7616)
Task/Issue URL: https://app.asana.com/1/137249556945/task/1212992299141095?focus=true ### Description > Note: Please, don't merge. The actual implementation is used to discuss about one possible solution to fix a glitch with the browser bottom sheet menu. ### Steps to test this PR _Bottom sheet menu opened from bottom after a full expand_ - [x] Open the application - [x] Turn on the new browser menu from appearance settings - [x] Come back to browser screen and open the menu - [x] Expand the menu and close it with a back button - [x] Open the menu again, it should be opened from the bottom - [x] Check the menu is well up dated for all modes (website, new tab, duck.ai and custom tab) ### UI changes https://github.com/user-attachments/assets/afbeadbe-c0e4-42bc-830b-eeaa7131d62b
1 parent 3d8a17d commit bdd44bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,8 +1387,13 @@ class BrowserTabFragment :
13871387
}
13881388

13891389
private fun launchBrowserMenu(addExtraDelay: Boolean = false) {
1390-
val useBottomSheetMenu = viewModel.browserViewState.value?.useBottomSheetMenu ?: false
1390+
val viewState = viewModel.browserViewState.value
1391+
val useBottomSheetMenu = viewState?.useBottomSheetMenu ?: false
13911392
if (useBottomSheetMenu && bottomSheetMenu != null) {
1393+
recreateBrowserMenu()
1394+
viewState?.let {
1395+
renderBrowserMenu(viewState = viewState, omnibarViewMode = omnibar.viewMode)
1396+
}
13921397
launchBottomSheetMenu(addExtraDelay)
13931398
} else if (!useBottomSheetMenu && popupMenu != null) {
13941399
val isSplitOmnibarEnabled = omnibarRepository.omnibarType == OmnibarType.SPLIT

0 commit comments

Comments
 (0)