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

[UWP] Make sure to update HitTestVisible when IsEnable changes #1015

Merged
merged 1 commit into from Jun 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,49 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System;
using System.Threading.Tasks;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 57749, "After enabling a disabled button it is not clickable", PlatformAffected.UWP)]
public class Bugzilla57749 : TestContentPage // or TestMasterDetailPage, etc ...
{
protected override void Init()
{
button1.Text = "Click me";
button1.AutomationId = "btnClick";
button1.IsEnabled = false;
button1.Clicked += Button1_Clicked1;
this.Content = button1;
}
Button button1 = new Button();

private void Button1_Clicked1(object sender, EventArgs e)
{
this.DisplayAlert("Button test", "Button was clicked", "Ok");
}

protected async override void OnAppearing()
{
base.OnAppearing();
await Task.Delay(100);
button1.IsEnabled = true;
}

#if UITEST
[Test]
public async void Bugzilla57749Test()
{
await Task.Delay(500);
RunningApp.Tap(c => c.Marked("btnClick"));
RunningApp.WaitForElement (q => q.Marked ("Button was clicked"));
}
#endif
}
}
Expand Up @@ -306,6 +306,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla54036.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla56896.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla40161.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzila57749.cs" />
<Compile Include="$(MSBuildThisFileDirectory)_Template.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue1028.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue1075.cs" />
Expand Down
4 changes: 4 additions & 0 deletions Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
Expand Up @@ -229,6 +229,10 @@ protected virtual void OnPropertyChanged(object sender, PropertyChangedEventArgs
{
UpdateInputTransparent(Element, Container);
}
else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
{
UpdateInputTransparent(Element, Container);
}
}

protected virtual void UpdateNativeControl()
Expand Down