Bug 29875 - IsEnabled does not work for Views derived from ViewElementRenderer<T>
Summary: IsEnabled does not work for Views derived from ViewElementRenderer<T>
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-08 08:58 UTC by John Miller [MSFT]
Modified: 2015-05-22 16:08 UTC (History)
6 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (179.80 KB, application/zip)
2015-05-08 08:58 UTC, John Miller [MSFT]
Details


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:
Status:
RESOLVED NOT_ON_ROADMAP

Description John Miller [MSFT] 2015-05-08 08:58:59 UTC
Created attachment 11128 [details]
Test Case

**Overview:**

   Any control which has a renderer derived from ViewElementRenderer<T> like Page, BoxView, Carousel, FrameView, TabbedView can't be disabled.
   The issue is that IsEnabled change is not handled and native view is not updated.

**Steps to Reproduce:**

   1. Run the attached sample on iOS or Android
   2. Touch the Red part of the screen, a tapped message is logged to the console
   3. After 3 seconds, the IsEnabled property is toggled to False
   4. Repeat steps #2, the tapped message is logged again.

**Actual Results:**

   Setting IsEnabled to false still registers touch events. 

**Expected Results:**

   Setting IsEnabled to false should disabled the view from registering touch events.

**Build Date & Platform:**

   Android and iOS
   XF 1.4.2
Comment 1 Jason Smith [MSFT] 2015-05-21 05:44:33 UTC
What does that even do? Great your Box isn't enabled, its now as inert as it previous was?
Comment 2 John Miller [MSFT] 2015-05-21 09:08:53 UTC
@Jason,

These controls can receive a TapGestureRecognizer. The Enabled property was thought to disable touch when there might be a GestureRecognizer on it. Similar to UserInteractionEnabled on iOS, and whatever is similar on Android. UIView does not inertly receive touch events, but if you add a gesture to it, UserInteractionEnabled controls if that gesture receives touch events or not. 

The Actual/Expected Results area explain what was expected.
Comment 3 John Miller [MSFT] 2015-05-22 16:08:12 UTC
It is suggested as a workaround to instead remove the gesture recognizer when the view should not be touchable.