-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dismiss is not working when tap outside of popup window #66
Comments
I encounter the same problem when I test the app on a Lollipop emulator. Removing this line can help although it's not a good solution: https://github.com/zawadz88/MaterialPopupMenu/blob/master/material-popup-menu/src/main/java/androidx/appcompat/widget/MaterialRecyclerViewPopupWindow.kt#L239 |
@cvezina @DeweyReed thanks for reporting this. |
It seems to be an issue on Lollipop only (5.0 and 5.1) - I've checked also API 19, 23, 25 & 28 and it's correct there on the emulator at least. |
This seems to be an issue with clipping rounded backgrounds #47 .
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
dropDownList.clipToOutline = true
// Move the background from popup to RecyclerView for clipToOutline to take effect.
dropDownList.background = background
popup.setBackgroundDrawable(null)
} to: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
dropDownList.clipToOutline = true
// Move the background from popup to RecyclerView for clipToOutline to take effect.
dropDownList.background = background
popup.setBackgroundDrawable(null)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
dropDownList.clipToOutline = true
// Move the background from popup to RecyclerView for clipToOutline to take effect.
dropDownList.background = background
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
popup.setBackgroundDrawable(null)
}
}
@Tunous do you have any thoughts on that? |
Option 2 appears to be a better solution in this case. I’m not sure whether removing it is entirely safe but I also don’t remember if there were any other issues which this line was intended to resolve. Most likely these were on other Android version (if ever). |
Fixed in 4.0.1. |
The popup window is not dismissed when you tap outside. You can reproduce the problem using the sample provided.
minSdkVersion 21
targetSdkVersion 28
The text was updated successfully, but these errors were encountered: