Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] iOS 15.5 TapGestureRecognizer triggers when tap in a wrong area when used with AbsoluteLayout #15517

Open
dimitar-sd opened this issue Aug 19, 2022 · 0 comments
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@dimitar-sd
Copy link

dimitar-sd commented Aug 19, 2022

Description

[iOS] TapGestureRecognizer is triggered in the wrong area when using AbsoluteLayout in iOS 15.5. (Works fine in iOS 15.4) Tested using the Simulator.

If you have two AbsoluteLayout components where the bottom one takes over the whole page and the top one is smaller in the middle of the page. The bottom one has TapGestureRecognizer.
Tapping over the top smaller one triggers the TapGestureRecognizer Tapped event (and it shouldn't). When tapping over the bottom large one it doesn't trigger the Tapped event (and it should).

Note this happens only of the bottom element uses absolute layout to take over the whole page. If the bottom element take a bit less of the page then the Tapped event is triggered as expected - only for the visible part of the bottom element.

Steps to Reproduce

  1. Create two absolute components on top of each other where the bottom one takes over the whole page and the top one is smaller.
    Example:
    `

< ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App2.Views.AboutPage"
xmlns:vm="clr-namespace:App2.ViewModels"
>

<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >

    <StackLayout BackgroundColor="Red" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0.0,0.0,1.0,1.0">
        <StackLayout.GestureRecognizers>
            <TapGestureRecognizer Tapped="TapGestureRecognizer_OnTapped"></TapGestureRecognizer>
        </StackLayout.GestureRecognizers>
    </StackLayout>

    <Frame x:Name="popupFrame" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds=".5,.5,.7,.4"
        HasShadow="false"
        VerticalOptions="Center" 
        HorizontalOptions="Center" 
        BackgroundColor="Blue"
        Padding="100,150,100,100" >
    </Frame>

</AbsoluteLayout>

< /ContentPage>
`
2. Tapping the visible part of the bottom element should trigger Tapped event (and it doesn't)
3. Tapping the smaller top element should not trigger the Tapped event (but it does)

Expected Behavior

  1. Tapping the visible part of the bottom element triggers Tapped event
  2. Tapping the smaller top element does not trigger the Tapped event

Actual Behavior

  1. Tapping the visible part of the bottom element does not trigger Tapped event
  2. Tapping the smaller top element triggers the Tapped event

Basic Information

  • Version with issue: VS 2022 17.3.1, Xamarin 5.0.0.2196
  • Last known good version: VS 2019
  • Platform Target: iOS 15.5 (works fine in iOS 15.4)

Screenshots

image

@dimitar-sd dimitar-sd added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 19, 2022
@dimitar-sd dimitar-sd changed the title [Bug] [iOS] TapGestureRecognizer triggers when tap in a wrong area when used with AbsoluteLayout [Bug] [iOS] iOS 15.5 TapGestureRecognizer triggers when tap in a wrong area when used with AbsoluteLayout Aug 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants
@dimitar-sd and others