Bug 44096 - Controls still participate in hit testing when inside a Grid, StackLayout, and ContentView that has IsEnabled = false
Summary: Controls still participate in hit testing when inside a Grid, StackLayout, an...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
: 53445 54462 58969 ()
Depends on:
Reported: 2016-09-08 06:22 UTC by adrianknight89
Modified: 2017-08-23 18:09 UTC (History)
13 users (show)

Tags: ac, bug, android, uwp
Is this bug a regression?: ---
Last known good build:

repro (207.36 KB, application/zip)
2016-09-08 06:22 UTC, adrianknight89
updated repro project (290.90 KB, application/x-zip-compressed)
2017-02-23 19:04 UTC, Jimmy [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description adrianknight89 2016-09-08 06:22:19 UTC
Created attachment 17372 [details]

Please see repro.

If you look at MainPage.xaml, you will see that I'm using a plain button, button inside a grid, button inside a stack layout, and button inside a content view. IsEnabled changes on Android do not propagate down to children.

If you tap on the buttons like a child, you will enqueue tap gestures that will be executed every 5 seconds and a datetime value will be written to the console.

iOS seems fine.
Comment 1 adrianknight89 2016-09-12 01:26:13 UTC
I think it is okay for children to be still enabled, so perhaps like iOS, IsEnabled changes don't have to propagate, but Grid, StackLayout, and ContentView should NOT participate in hit testing so the child button should not be clickable.
Comment 2 Samantha Houts [MSFT] 2016-09-30 23:18:19 UTC
Should be fixed in 2.3.4-pre1. Thank you!
Comment 3 Clint 2016-11-23 15:26:36 UTC
So this bug (44096) is a duplicate of the earlier reported 43007 ???
I guess the important thing is it is fixed in the new 2.3.4-pre1
Comment 4 Parmendra Kumar 2016-11-28 16:42:45 UTC
I have checked this issue with xamarin.forms 2.3.4-pre1 and I have still getting same issue.

Hence reopened this issue.

Comment 5 adrianknight89 2016-11-28 17:00:40 UTC
Better fix: https://github.com/xamarin/Xamarin.Forms/pull/483
Comment 6 Jimmy [MSFT] 2017-02-23 18:59:21 UTC
*** Bug 46458 has been marked as a duplicate of this bug. ***
Comment 7 Jimmy [MSFT] 2017-02-23 19:03:31 UTC
*** Bug 43007 has been marked as a duplicate of this bug. ***
Comment 8 Jimmy [MSFT] 2017-02-23 19:04:55 UTC
Created attachment 19927 [details]
updated repro project

This issue is still reproducible and is also affecting UWP, not just Android.

### Repro status          BAD     BAD   BAD

I'm attaching a modified project from bug #46458 that includes a UWP project.
Comment 9 Paul DiPietro [MSFT] 2017-03-17 13:59:17 UTC
*** Bug 53445 has been marked as a duplicate of this bug. ***
Comment 10 Rui Marinho 2017-03-23 17:26:46 UTC
Should be fixed on 2.3.5-pre1.
Comment 11 Jimmy [MSFT] 2017-04-04 20:39:52 UTC
*** Bug 54462 has been marked as a duplicate of this bug. ***
Comment 12 Clint 2017-07-07 18:48:36 UTC
Still broken in 2.3.5-pre6 - yes 6.

Simple example with the scrollview disabled and the StackLayout also disabled will still allow the user to scroll up and down.

        <ScrollView x:Name="testScroll"
          <StackLayout Orientation="Vertical"
            <Label>Mr. Slate</Label>
            <Label>Great Gazoo</Label></StackLayout>
Comment 13 E.Z. Hart [MSFT] 2017-07-10 17:04:50 UTC
This has nothing to do with which controls the ScrollView is hosted in; ScrollViews on Android and iOS are just ignoring the IsEnabled property. It's a separate bug, fixed by https://github.com/xamarin/Xamarin.Forms/pull/1049.
Comment 14 Saurabh Paunikar 2017-07-12 11:10:22 UTC
Verified on xamarin.form version Verified on both android and UWP

ScreenCast link: https://www.screencast.com/t/YCwzSGBnMF
Comment 15 Jimmy [MSFT] 2017-08-23 18:09:50 UTC
*** Bug 58969 has been marked as a duplicate of this bug. ***