Bug 38269 - Entry/keyboard should expose a method to accept highlighted keyboard shortcut
Summary: Entry/keyboard should expose a method to accept highlighted keyboard shortcut
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-02-01 18:48 UTC by russ
Modified: 2017-06-19 15:34 UTC (History)
5 users (show)

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

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:

Description russ 2016-02-01 18:48:03 UTC
There currently appears to be no way to support standard iOS behavior of automatically accepting a suggestion on an Entry.

If you were to send a message on the native iOS Messages app, and the last word is misspelled, when you tap Send it will automatically accept that last suggestion.  I've been unable to replicate this behavior in Xamarin Forms.

I would like to be able to order my Entry to accept any current highlighted suggestion.

I _can_ explicitly order the Entry to UnFocus in my button handler, which appears to accept the change in the UI, but doesn't actually change it underneath the hood.  Looks like the same underlying issue as #38265.  Here's some repro code extremely similar to that from #38265:

	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();

			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 "typni" and then touch Send as soon as a suggestion comes up.  The Entry will display "typing" but the Entry's Text property remains "typni".
Comment 1 Rui Marinho 2017-06-19 15:34:37 UTC
This is fixed on latest stable versions.