Skip to content
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

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

Open
mattleibow opened this issue Nov 29, 2023 · 2 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter t/bug Something isn't working
Milestone

Comments

@mattleibow
Copy link
Member

mattleibow commented Nov 29, 2023

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 />
@mattleibow mattleibow added t/bug Something isn't working area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels Nov 29, 2023
@mattleibow mattleibow added this to the Backlog milestone Nov 29, 2023
@ghost
Copy link

ghost commented Nov 29, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@gktval
Copy link

gktval commented Dec 4, 2023

Following this issue. This is related to a previous issue I created, but closed. #18470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants