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
Allow LayoutView to pass touches to child controls when CascadeInputTransparent is false #7236
Conversation
…ransparent is false Fixes #6574
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Is this correct behaviour? When we set a parent to input transparent, we still want the children to be hit? Is there a way to say "make this layout and everything in it transparent"? |
Yes, this is correct. We want the option of setting a parent to be input transparent, while still allowing the children to be hit. Consider a UI with a map control, and an overlay with, say, a zoom slider and a couple of buttons. The layout which contains the overlay controls needs to be input transparent (so the user can interact with the map), but the controls it contains should not be input transparent.
Yes, that's what the |
This is not the correct behavior/what should happen. MSDN specifically says CascadeInputTransparent is True by default. Which causes all children in a layout to inherit the InputTransparent value of the parent layout. E.g. InputTransparent="True" on a parent layout implicity sets InputTransparent="True" on all of it's children. This is logically what should happen. Since children will block antecedents, and you could have MANY MANY children, it's a LOT easier to set a cascading property that's inherited, which will be respected until another CascadeInputTransparency is found down in the tree, versus setting InputTransparent="True" on, depending on the complexity of the tree, a lot of UI elements. Either the docs need to be fixed, or the code needs to be fixed. I'd prefer the code to follow what the docs say IMO.
I found this issue searching for other input transparency issues to see if I could fix my own input issue #7489 |
This was a change for MAUI.Core to allow for the situation where |
Description of Change
The default InputTransparent handling for LayoutView is disabling all user interaction, including with child controls. For situations where the Layout is InputTransparent but the child controls are not, this prevents interaction with the child controls.
These changes allow the LayoutView on iOS to pass touches through to child controls when it's corresponding Layout is InputTransparent, making it consistent with the other platforms.
This also removes some old code for enabling gestures on layouts that pre-dates the InputTransparent implementation for MAUI.Core (see #1190).
Issues Fixed
Fixes #6574