Xamarin.forms: [Enhancement] Editor: Control over text-prediction

Created on 13 Aug 2018  Â·  6Comments  Â·  Source: xamarin/Xamarin.Forms

Rationale

1677 for Editor

Editors do not currently allow users to disable text prediction/autocomplete/autosuggest without a custom renderer or effect.

Implementation

Add bindable property to Editor:

public static readonly BindableProperty IsTextPredictionEnabledProperty = BindableProperty.Create("IsTextPredictionEnabled", typeof(bool), typeof(Editor), true);

Renderers will need to be updated accordingly.

Expected Result

Android

  • IsTextPredictionEnabled == true: Default. Text prediction is enabled.
  • IsTextPredictionEnabled == false: Text prediction is disabled.

iOS

  • IsTextPredictionEnabled == true: Default. Text prediction is enabled. Note: may also disable autocorrect.
  • IsTextPredictionEnabled == false: Text prediction is disabled.

UWP

  • IsTextPredictionEnabled == true: Default. Text prediction is enabled.
  • IsTextPredictionEnabled == false: Text prediction is disabled.

Implications for CSS

None

Backward Compatibility

Since we are adding new properties, there should be no compatibility problems as long as:

  1. We ensure that an Editor's text prediction defaults to enabled, as is the expected behavior now,
  2. We ensure that any Effects or Custom Renderers that may have been created to produce this behavior take precedence over any values that we set, to the best of our ability.

Third party renderers will need to be updated to ensure that this functionality is officially supported.

Difficulty : Easy-Medium

This is an easy-medium change and great for a first-time contributor. Biggest challenge will be ensuring that disabling text prediction does not also disable other features of the Editor view on all platforms.

help wanted enhancement âž• up-for-grabs

All 6 comments

Hi @samhouts I'd like to tackle this one.
Any suggestions/code pointers? I'll start by reviewing #1677

@noamyogev84 Great! I know that we had conflicts with the SpellCheckEnabled property for Entry, but otherwise, this should be pretty straightforward. Good luck, and let us know if we can help! Thank you!

Hi @samhouts.
Please let me know if anything's missing. I've tested the new behavior both with the UWP Gallery Project, and with Android Emulator. seems OK.

I'll be happy to do any modifications if needed.

Hi, can I please fix this issue as my Hackocterfest PR?

Wouldn't it be better to add this property to Entry and Editor's base class InputView than to have it duplicated?

I'll wait for you guys are sure what specific changes I have to do :)

Was this page helpful?
0 / 5 - 0 ratings