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

[BUG] Grid is always InputTransparent (.NET MAUI 9.0 Preview 2) #21553

Closed
janne-hmp opened this issue Apr 1, 2024 · 5 comments
Closed

[BUG] Grid is always InputTransparent (.NET MAUI 9.0 Preview 2) #21553

janne-hmp opened this issue Apr 1, 2024 · 5 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@janne-hmp
Copy link

janne-hmp commented Apr 1, 2024

Description

It seems that all grids are InputTransparent even when InputTransparent is set to false.

Steps to Reproduce

  1. Create an default .NET MAUI project
  2. Add a Grid on the top of the existing default XAML (by making a root grid and putting the new Grid and ScrollView into it). Set the Grid's InputTransparent to false (and Horizontal and Vertical Options to FillAndExpand so it covers the Button for sure)

XAML is then:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Net9MauiTest.MainPage">

    <Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <ScrollView>
            <VerticalStackLayout
                Padding="30,0"
                Spacing="25">
                <Image
                    Source="dotnet_bot.png"
                    HeightRequest="185"
                    Aspect="AspectFit"
                    SemanticProperties.Description="dot net bot in a race car number eight" />

                <Label
                    Text="Hello, World!"
                    Style="{StaticResource Headline}"
                    SemanticProperties.HeadingLevel="Level1" />

                <Label
                    Text="Welcome to &#10;.NET Multi-platform App UI"
                    Style="{StaticResource SubHeadline}"
                    SemanticProperties.HeadingLevel="Level2"
                    SemanticProperties.Description="Welcome to dot net Multi platform App U I" />

                <Button
                    x:Name="CounterBtn"
                    Text="Click me" 
                    SemanticProperties.Hint="Counts the number of times you click"
                    Clicked="OnCounterClicked"
                    HorizontalOptions="Fill" />
            </VerticalStackLayout>
        </ScrollView>
        <Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" InputTransparent="False" />
    </Grid>
</ContentPage>
  1. Build the project
  2. You can still press the button

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.1.9973

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 14, perhaps all others as well, did not test

Did you find any workaround?

Yes, I added an empty TapGestureRecognizer to the Grid, but the point is that InputTransparent does not work for the Grid. If it is intended, InputTransparent should be marked deprecated for Grid.

Relevant log output

No response

@janne-hmp janne-hmp added the t/bug Something isn't working label Apr 1, 2024
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Apr 1, 2024
@jaosnz-rep
Copy link

jaosnz-rep commented Apr 2, 2024

Verified on 9.0.0-preview.2.10293 & 9.0.0-preview.1.9973 & 8.0.14, can repro on Android platform, after replacing the code I can still click the button.

@jaosnz-rep jaosnz-rep added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version potential-regression This issue described a possible regression on a currently supported version., verification pending labels Apr 2, 2024
Copy link
Contributor

Hi @janne-hmp. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jaosnz-rep jaosnz-rep added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Apr 2, 2024
@janne-hmp
Copy link
Author

janne-hmp commented Apr 2, 2024

What is the latest version? I'm using the following (.NET MAUI 9.0 Preview 2 / Visual Studio 17.10.0 Preview 2.0), There was just no option to select the latest .NET 9.0 Preview 2 version in the Bug report drop box on GitHub issues; perhaps you can add that?

Microsoft Visual Studio Community 2022
Version 17.10.0 Preview 2.0
VisualStudio.17.Preview/17.10.0-pre.2.0+34707.107
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2022   00482-90000-00000-AA350
Microsoft Visual C++ 2022

ASP.NET and Web Tools   17.10.173.6507
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.10.173.6507
Azure App Service Tools v3.0.0

C# Tools   4.10.0-3.24127.5+e3d617bc46b0f92c2d2438188b35e009b942d0d1
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Extensibility Message Bus   1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Linux Core Dump Debugging   1.0.9.34707
Enables debugging of Linux core dumps.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.10.4 (67e63f0)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   6.10.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.10.2.2415507+c5753a9c23d8422e24ed842c0ddad71e84d900d1
Provides languages services for ASP.NET Core Razor.

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   17.0.30221.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.10.0-3.24127.5+e3d617bc46b0f92c2d2438188b35e009b942d0d1
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Cross Platform Mobile Development (Android)   15.0.34707.36
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   15.0.34707.36
Visual C++ for Cross Platform Mobile Development (iOS)

Visual C++ for Linux Development   1.0.9.34707
Visual C++ for Linux Development

Visual F# Tools   17.10.0-beta.24127.3+b57dee7cec971021547a7b8a36a46d7271fea99e
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSPackage Extension   1.0
VSPackage Visual Studio Extension Detailed Info

Xamarin   17.10.0.81 (main@b6ae522)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.10.1.36 (remotes/origin/d17-10@cf22639d5c)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.9.0 (38e87ba)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: d9a6e87
    Java.Interop: xamarin/java.interop/d17-5@149d70fe
    SQLite: xamarin/sqlite/3.40.1@68c69d8
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d


Xamarin.iOS and Xamarin.Mac SDK   16.4.0.23 (9defd91b3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

@samhouts samhouts added the migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert label Apr 22, 2024
@PureWeen PureWeen removed the potential-regression This issue described a possible regression on a currently supported version., verification pending label May 1, 2024
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jun 6, 2024
@mattleibow
Copy link
Member

Duplicate of #10252

@mattleibow mattleibow marked this as a duplicate of #10252 Jun 20, 2024
@mattleibow
Copy link
Member

There was a workaround found in #9153 (comment)

Simplest workaround for me was adding an empty TapGestureRecognizer to the view that's over top.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants