An unstyled Menu (Dropdown) Compose Multiplatform component with keyboard navigation and animation support.
Add a new alignment
parameter on the MenuContent
composable, that controls how the MenuContent
is anchored to the MenuButton
when expanded. (fixed https://github.com/composablehorizons/compose-menu/issues/3)
Example:
Menu {
MenuButton {
BasicText("Toggle the menu")
}
MenuContent(alignment = Alignment.End) {
MenuItem(onClick = { /* TODO */ }) {
BasicText("Option")
}
}
}
MenuScope
's constructor from public APICompile with Java 17, in order to avoid Java mismatches on JVM targets. Special thanks to @rock3r for the code sample.
https://github.com/composablehorizons/compose-menu/commit/7e0e92972cd884340ef8692eafb4b016db46cf52 Fix a bug where pressing the keyboard Up
or Down
keys would not move the focus of the MenuItems
if the menu did not already have focus. (thanks @krzema12 for the bug report)