Bug 38265 - Keyboard suggestions on Forms iOS do not function correctly on last word in Entry
Summary: Keyboard suggestions on Forms iOS do not function correctly on last word in E...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS (show other bugs)
Version: 2.0.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-02-01 18:25 UTC by russ
Modified: 2016-11-23 18:27 UTC (History)
6 users (show)

See Also:
Tags: ac
Is this bug a regression?: No
Last known good build:


Attachments

Description russ 2016-02-01 18:25:21 UTC
Possibly a duplicate of #31422, but here goes:

Pressing Return on the iOS keyboard when typing within an Entry does not actually trigger a TextChanged event, though the Entry does update on screen.  In order to actually accept a highlighted suggestion, you have to press space, add a punctuation character, or touch the suggestion (which adds a space).

Sample page exhibiting the behavior:
	public class SamplePage : ContentPage
	{
		Entry entry = null;
		Label lbl = null;

		public SamplePage()
		{
			entry = new Entry();
			entry.Keyboard = Keyboard.Create(KeyboardFlags.Suggestions);
			entry.MinimumWidthRequest = 100;
			entry.TextChanged += Entry_TextChanged;

			Button btn = new Button();
			btn.Text = "Send";
			btn.Clicked += SendMessage_Clicked;

			lbl = new Label();
			lbl.Text = "Text will go here";

			StackLayout layout = new StackLayout();
			layout.Children.Add(entry);
			layout.Children.Add(btn);
			layout.Children.Add(lbl);

			Content = layout;
			Padding = new Thickness(5, 18);
		}

		void Entry_TextChanged (object sender, TextChangedEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("Text seen: " + e.NewTextValue);
		}

		void SendMessage_Clicked (object sender, EventArgs e)
		{
			lbl.Text = entry.Text;
		}
	}


Start typing the word "typni" in the box.  When the "typing" suggestion comes up, hit Return.  The Entry will update to read "typing" but TextChanged doesn't trigger, and Text still shows "typni".
Comment 1 russ 2016-02-01 21:39:07 UTC
Also, same behavior occurs when the Entry loses focus.  The currently highlighted suggestion will be visually accepted upon focus loss, but the underlying Text property does not change, and no TextChanged event fires.
Comment 3 Mac Server 2016-07-13 18:00:32 UTC
Experiencing this issue as well. Both suggestions and autocorrect (autoreplace) and the unfocused event or the return button fail to capture the changed text, allowing for invalid or unwanted text to be submitted in forms.

Submitted possibly duplicate Bug 42530
https://bugzilla.xamarin.com/show_bug.cgi?id=42530
Comment 4 adrianknight89 2016-09-30 16:26:49 UTC
See https://github.com/xamarin/Xamarin.Forms/pull/401
Comment 5 Samantha Houts [MSFT] 2016-10-20 19:34:58 UTC
Should be fixed in 2.3.4-pre1. Thank you!
Comment 6 Parmendra Kumar 2016-11-23 18:27:22 UTC
I have checked this issue with Xamarin.Forms 2.3.4-pre1 and this issue has been fixed.

Hence closing this issue.

Note You need to log in before you can comment on or make changes to this bug.