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

Aditya Murthy

01/25/2022, 11:22 PM
I have container that houses a few composable buttons in it. Is there a way to make the contents of the container visible, without making them clickable? I know I can individually add logic to the buttons and make them un-clickable, but I wanted to check if I can control this at a higher level (Similar to a glass panel - you can still see everything behind the panel, but can't interact with it)
c

Chris Sinco [G]

01/25/2022, 11:43 PM
I think you can use the
drawWithContent
modifier to draw a transparent rectangle in front of the content (buttons) to block them
a

Aditya Murthy

01/26/2022, 1:03 AM
thanks! this allowed me to draw the rectangle on top of my container, but doesn't prevent me from clicking through to the contents of the container
c

Chris Sinco [G]

01/26/2022, 4:23 AM
Have you already tried using Box and putting a transparent layer on top of the container?
a

Albert Chang

01/26/2022, 6:31 AM
You can’t now. There’s an issue for this.
👍 2
👀 1
a

Aditya Murthy

01/26/2022, 6:11 PM
thanks for your input guys!
3 Views