You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2024. It is now read-only.
[Issue(IssueTracker.Github,12497,"Calling Focus() on a WebView on UWP does not move the focus to the WebView",PlatformAffected.UWP)]
19
+
publicclassIssue12497:TestContentPage// or TestFlyoutPage, etc ...
20
+
{
21
+
bool_firstTimeOnAppearing=true;
22
+
Button_button1;
23
+
Button_button2;
24
+
Button_button3;
25
+
WebView_webView;
26
+
27
+
protectedoverridevoidInit()
28
+
{
29
+
PopulatePage();
30
+
}
31
+
protectedoverridevoidOnAppearing()
32
+
{
33
+
base.OnAppearing();
34
+
35
+
if(_firstTimeOnAppearing)
36
+
{
37
+
_firstTimeOnAppearing=false;
38
+
39
+
//PopulatePage();
40
+
41
+
// The following is just here as a convenience.
42
+
// It's a nasty, hacky way of setting the initial focus,
43
+
// that introduces a race condition. Good enough for
44
+
// this repro sample though.
45
+
Task.Run(async()=>
46
+
{
47
+
awaitTask.Delay(1000);
48
+
if(_button1!=null)
49
+
_button1.Focus();
50
+
51
+
});
52
+
}
53
+
}
54
+
55
+
voidPopulatePage()
56
+
{
57
+
intdefaultTabIndex=Int32.MaxValue;// UWP says this should be the max int. Xamarin.Forms docs say it should be 0;
58
+
59
+
_button1=newButton
60
+
{
61
+
Text="Button 1 (should be first in tab order)",
62
+
TextColor=Color.Black,
63
+
BackgroundColor=Color.White,
64
+
TabIndex=defaultTabIndex,
65
+
VerticalOptions=LayoutOptions.Start
66
+
};
67
+
68
+
_webView=newWebView
69
+
{
70
+
BackgroundColor=Color.White,
71
+
HorizontalOptions=LayoutOptions.Fill,
72
+
TabIndex=defaultTabIndex,
73
+
VerticalOptions=LayoutOptions.FillAndExpand,
74
+
Source=newHtmlWebViewSource
75
+
{
76
+
Html="<html><body>Hello (should be second in tab order)<br>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29</body></html>"
Copy file name to clipboardExpand all lines: Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
0 commit comments