is there any way to have a `DropdownMenu` appear i...
# compose
j
is there any way to have a
DropdownMenu
appear in the position of a click? I'd like to capture the x, y position of a click event and have the
DropdownMenu
anchored to that position, rather than it just anchoring itself in the default position
d
I think you want
ContextMenu
and not
DropdownMenu
.
j
thanks Dominic, but I'm after a Composable, not something from the
android.view
package. the solution I've built using Compose's
DropdownMenu
works great, I'd just like to change the UX slightly and change the placement of the menu
d
Ah, it's a composable function but it appears to be desktop only.
­čśó 1
r
@james try
onGloballyPositioned
-> positionInParent you will get x,y position and anchor DropDownMenu to that.