Closed emirhanemmez closed 2 months ago
Hello, @emirhanemmez! Could you please reproduce that behavior on a clean project from the template and attach it here?
Hello, @mazunin-v-jb I captured the bug. It actually happens when you give large list to dropdownmenu. I was trying to give large country list so I got this error. You can check from this repo. There are 2 spinner here. The one has large list, other one has short list. Only the spinner with large list is not working. It works on Android fyi.
Hello @elijah-semyonov , maybe it will help. When you describe DropdownMenuItem
with LazyColumn
not with forEach
and give specific height
and width
to LazyColumn
, it works on ios as well.
Old code:
ExposedDropdownMenu(
modifier = Modifier.width(100.dp)
.background(Color.White)
.height(300.dp),
expanded = isExpanded,
onDismissRequest = {
onExpandChange.invoke(false)
}
) {
languages.forEach { language ->
DropdownMenuItem(
modifier = Modifier.background(Color.White),
text = {
Text(
text = language,
)
},
onClick = {
onExpandChange.invoke(false)
onLanguageSelected.invoke(language)
}
)
}
}
New code:
ExposedDropdownMenu(
expanded = isExpanded,
onDismissRequest = {
onExpandChange.invoke(false)
}
) {
LazyColumn(
modifier = Modifier
.width(200.dp)
.height(300.dp)
) {
items(languages) { language ->
DropdownMenuItem(
modifier = Modifier.background(Color.White),
text = {
Text(
text = language.name,
style = appTypography.bodyMedium,
color = textColor
)
},
onClick = {
onExpandChange.invoke(false)
onLanguageSelected.invoke(language)
}
)
}
}
}
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug I'm using ExposedDropdownMenuBox in Compose multi platform. It works fine in Android but somehow its not working on ios. I cannot see DropdownMenuItems but I can select something when I pretend its visible. Here is my code:
Affected platforms
Versions
This is the expected behavior (Android screenshot)
And this is on iPhone https://github.com/JetBrains/compose-multiplatform/assets/33161529/b4ae2c6d-cc3d-4bc4-a050-553c71a82a2d
When I click dropdown component