https://kotlinlang.org logo
#compose
Title
# compose
u

Utkarsh Tiwari

03/09/2021, 9:15 AM
Hi folks, I am not sure who is the right person to consult regarding this. I am playing around with the code from the official documentation of
ModalBottomSheetLayout
and it seems like the scrim to dismiss the modal is being triggered when tapping an area within the sheet. Is this expected behaviour? Here is my code
p

patrick

03/09/2021, 9:18 AM
Does that change when you wrap the Buttons of the BottomSheet in a Column with full width? ie:
Copy code
sheetContent = {
            Column(modifier=Modifier.fillMaxWidth()) {
                PrimaryButton(
                    text = "Hello",
                    onClick = {

                    }
                )
                PrimaryButton(
                    text = "Elon's",
                    onClick = {

                    }
                )
                PrimaryButton(
                    text = "World",
                    onClick = {

                    }
                )
            }
        }
🙏 1
u

Utkarsh Tiwari

03/09/2021, 9:21 AM
Same behaviour with this code.
p

patrick

03/09/2021, 9:30 AM
Looks like the tap is still passed on to the scrim, I guess an empty clickable modifier on the column would “fix” it 😞
😢 1
u

Utkarsh Tiwari

03/09/2021, 12:38 PM
@patrick You are right. Adding clickable “fixes” the problems.
I have filed a bug in case anyone is interested in following: https://issuetracker.google.com/issues/182193069
j

jossiwolf

03/14/2021, 10:29 AM
Compared to BottomDrawer, ModalBottomSheetLayout doesn't block clicks (not sure if there's a spec for that somewhere...), but I think @matvei and I recently talked about that it'd make sense to unify that behavior🤔 Matvei, I'd be happy to create a CL for this if you agree that this change makes sense
🦸 1
🙏 1
(So yeah, not a bug per se, more intended behavior I think, but there are probably more arguments for blocking clicks than not)
m

matvei

03/15/2021, 10:58 AM
We need to clock clicks, it's easier to opt in (also rarely needed) than to opt out. We just fixed it for a stable ModalDrawer, but we need to fix it for ModalBottomSheetLayout and others (Backdrop potentially, etc).
Thanks for filing a bug
🙇 1
3 Views