I stumbled upon a simple Dialog open behavior. If I use a component with “WhilePressing” visual effect (like e.g. background dimming), then both onTap and onTouchUp actions won’t cancel the effect.
You see, I use Material Design 3 Kit components (e.g. “Card”). And they have the “while pressing” effect already built-in, so I can’t really interfere and do that.
Instead, I’d need to create the card from scratch to include the initial state restoration.
Thank you!
P.S. Interestingly, since I’ve started using Material Design 3 Kit, I only reduce the number of components I include in my designs as I have to replace them with custom components that work more correctly. So this one is just one more reason why MD3K is more a toy, and not something ready for real applications.
I’m picking one of Nellya’s answers as a solution. It involves manual state restoration with “after delay”. Yet, the question on how to achieve that more easily - is still open.
I would have added this text to where it should be - in the first posting, but forum rules don’t allow editing.