summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2016-12-22 12:46:57 -0600
committerJason Smith <jason.smith@xamarin.com>2016-12-22 10:46:57 -0800
commit0c87fcff41bef841f83ef62de5cdc3d821980d33 (patch)
treea0ec542fda6603344b4ee0729a1a8db1e184bfaf
parent9d2290b2ac6753b037edfc9f0b1cfeaa69c5d815 (diff)
downloadxamarin-forms-0c87fcff41bef841f83ef62de5cdc3d821980d33.tar.gz
xamarin-forms-0c87fcff41bef841f83ef62de5cdc3d821980d33.tar.bz2
xamarin-forms-0c87fcff41bef841f83ef62de5cdc3d821980d33.zip
[iOS] Entry should not pass a newline to the next responder (#397)
* UITextField should not return so that the next field does not get passed a newline * Added code sample
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33248.cs53
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs2
3 files changed, 55 insertions, 1 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33248.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33248.cs
new file mode 100644
index 00000000..8f972312
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33248.cs
@@ -0,0 +1,53 @@
+using System;
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using NUnit.Framework;
+using Xamarin.UITest;
+
+#endif
+
+namespace Xamarin.Forms.Controls.TestCasesPages
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 33248, "Entry.Completed calling Editor.Focus() inserts new line to the focused Editor in iOS", PlatformAffected.iOS)]
+ public class Bugzilla33248 : TestContentPage
+ {
+ protected override void Init()
+ {
+ var editor = new Editor
+ {
+ BackgroundColor = Color.Yellow,
+ HeightRequest = 300
+ };
+ var entry = new Entry
+ {
+ BackgroundColor = Color.Red,
+ HeightRequest = 100
+ };
+
+ entry.Completed += (sender, e) => editor.Focus();
+
+ Content = new StackLayout
+ {
+ VerticalOptions = LayoutOptions.Start,
+ Children =
+ {
+ new Label
+ {
+ HorizontalTextAlignment = TextAlignment.Center,
+ Text = "Entry:"
+ },
+ entry,
+ new Label
+ {
+ HorizontalTextAlignment = TextAlignment.Center,
+ Text = "Editor:"
+ },
+ editor
+ }
+ };
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
index a420489c..fe0df146 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
@@ -55,6 +55,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla32847.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla33248.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla33268.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla33612.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla33714.cs" />
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs
index e4536cf8..a50a4e7a 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs
@@ -124,7 +124,7 @@ namespace Xamarin.Forms.Platform.iOS
{
Control.ResignFirstResponder();
((IEntryController)Element).SendCompleted();
- return true;
+ return false;
}
void UpdateAlignment()