Skip to content

Layouts block input even when they do not have a background (null background) #19124

Open
@mattleibow

Description

@mattleibow

Description

.NET MAUI does things a bit different to other XAML worlds where a layout will block interaction unless that layout is explicitly marked as input transparent.

The default for other XAML platforms, like WinUI, is to allow interaction through the layout - unless you assign a background - even a transparent color. Setting a null background makes the layout no longer hit testable and input passes through.

I have seen arguments for both ways where adding a layout was expected to block but did not. Then setting a color suddenly changes this - especially if that color is transparent. The other side always expected the layout to not block for null/transparent because you can see through it.

  • What should the defaults be?
  • Is it too late to change?

Some options:

  1. Always block interaction unless InputTransparent="True" CURRENT
    • ✅ This is consistent with the layouts, color does not mean anything - only the InputTransparent property
    • ✅ The dev only has to think about one property to toggle input transparency
    • ✅ Adding a layout to add a loading screen or popup/modal blocks by default
    • ❌ This is different to all other XAML frameworks
  2. null backgrounds do not block, only transparent/colors
    • ✅ This is consistent with other XAML frameworks
    • ✅ Adding a layout over a UI to host something does not block unless told to do so
    • ❌ The only way to block input is to add a transparent background color
    • ❌ There is no visual difference to null vs Transparent color

Steps to Reproduce

<Grid>
    <Button />
    <Grid />
<Grid />

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresentert/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions