Skip to content

[Android] Grid InputTransparent causes incorrect layout in modal ContentPage #33471

@paulober

Description

@paulober

Description

On Android, a Grid with InputTransparent="True" inside a modal ContentPage (transparent background) doesn't fill the available space on first render. Gaps appear at bottom and right edges. After Hot Reload, it expands correctly. iOS works fine.

Steps to Reproduce

  1. Create ContentPage with BackgroundColor="Transparent"
  2. Add overlapping Grid elements (same Row/Column)
  3. Set InputTransparent="True" on overlay Grid
  4. Open as modal: Navigation.PushModalAsync(page, false)
  5. Run on Android → Overlay Grid doesn't fill screen

Expected: Overlay fills entire screen
Actual: Gaps at bottom/right on first render

<ContentPage BackgroundColor="Transparent">
    <Grid SafeAreaEdges="None" RowDefinitions="*" ColumnDefinitions="*">
        <Grid Grid.Row="0" Grid.Column="0" BackgroundColor="Black" SafeAreaEdges="None" />
        <Grid Grid.Row="0" Grid.Column="0" BackgroundColor="Aqua" InputTransparent="True" SafeAreaEdges="None" />
    </Grid>
</ContentPage>

Link to public reproduction project repository

https://github.com/paulober/maui-layout-modal-bug-repro

Version with bug

10.0.20

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

Android API v36 but probably also earlier

Did you find any workaround?

Yes. Remove InputTransparent="True" and use TapGestureRecognizer on the Grid instead:

<Grid Grid.Row="0" Grid.Column="0">
    <Grid.GestureRecognizers>
        <TapGestureRecognizer Command="{Binding CloseCommand}"/>
    </Grid.GestureRecognizers>
</Grid>

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions