Status Update
Comments
cl...@google.com <cl...@google.com>
po...@google.com <po...@google.com> #2
I think this behavior is in line with the Material spec. Perhaps Farheen can take a look to double check :)
Chris you can look at the dropdownOffset
parameter. It is intended to provide a way to account for the empty space around icons, but I think you can also use it to align to the right edge of the menu if the size of the icon is known.
ch...@google.com <ch...@google.com> #3
Yeah, I could use onPositioned
on the icon, then offset
but that feels like a lot of work :)
I'm not sure the current positioning is to spec:
po...@google.com <po...@google.com>
fa...@google.com <fa...@google.com> #4
Thanks, Mihai! I agree with Chris. In the use case in
A couple additional notes from
- In general, a dropdown menu is positioned relative to both the element that generates it and the edges of the screen or browser. It can open in different ways adapting to the space available--for example, with long menus to avoid scrolling, it may be positioned as it is in the attached screenshot.
- Specifically, however, the dropdown menu's default position per spec is still below the element that generates it.
Assigning back to Mihai. Lmk if you have any questions!
ap...@google.com <ap...@google.com> #5
Branch: androidx-master-dev
commit 75c7797014451a1cecf6afcf488b3519283cb6a9
Author: Mihai Popa <popam@google.com>
Date: Thu Dec 03 13:37:04 2020
Fix positioning of DropdownMenu
Relnote: The positioning behaviour of DropdownMenus was slightly changed according to the Material spec.
Fixes: 168594123
Test: MenuTest
Change-Id: I34c721d5c6a710161af31bf131c7751740fb966c
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/MenuDemo.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
Description
See the attached screenshot. The toggle is the overflow icon button, and the menu is opened with it's right top edge == bottom left edge of the button.
Ideally I want the menu to overlap/cover the button (top right == top right), or at least have it's right edge in line with the right edge of the button.