Skip to content

Commit

Permalink
Fix popup menu IllegalStateException (#5137)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1200204095367872/1208539373099910/f

### Description
Fixes a `IllegalStateException` when showing the omnibar menu.

### Steps to test this PR

- [x] Tap the omnibar menu
- [x] Verify that the omnibar is shown
  • Loading branch information
joshliebe authored Oct 15, 2024
1 parent 826258c commit cb6d614
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1026,11 +1026,13 @@ class BrowserTabFragment :
private fun launchPopupMenu() {
// small delay added to let keyboard disappear and avoid jarring transition
binding.rootView.postDelayed(POPUP_MENU_DELAY) {
popupMenu.show(binding.rootView, omnibar.toolbar)
if (isActiveCustomTab()) {
pixel.fire(CustomTabPixelNames.CUSTOM_TABS_MENU_OPENED)
} else {
pixel.fire(AppPixelName.MENU_ACTION_POPUP_OPENED.pixelName)
if (isAdded) {
popupMenu.show(binding.rootView, omnibar.toolbar)
if (isActiveCustomTab()) {
pixel.fire(CustomTabPixelNames.CUSTOM_TABS_MENU_OPENED)
} else {
pixel.fire(AppPixelName.MENU_ACTION_POPUP_OPENED.pixelName)
}
}
}
}
Expand Down

0 comments on commit cb6d614

Please sign in to comment.