|
| 1 | +--- |
| 2 | +title: Disabling iOS Auto-Correction in RadAutoComplete for Correct Text Selection |
| 3 | +description: Fixing the issue where iOS auto-correction inserts incorrect text instead of selected items in RadAutoComplete. |
| 4 | +type: how-to |
| 5 | +page_title: Resolving Incorrect Text Issue in iOS RadAutoComplete |
| 6 | +meta_title: Resolving Incorrect Text Issue in iOS RadAutoComplete |
| 7 | +slug: ios-autocomplete-text-prediction-issue |
| 8 | +tags: autocomplete, ios, text-prediction, istextpredictionenabled |
| 9 | +res_type: kb |
| 10 | +--- |
| 11 | + |
| 12 | +## Environment |
| 13 | + |
| 14 | +| Version | Product | Author | |
| 15 | +| --- | --- | ---- | |
| 16 | +| 11.0.1 | AutoComplete for .NET MAUI | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova) | |
| 17 | + |
| 18 | +## Description |
| 19 | + |
| 20 | +When using [AutoComplete](https://docs.telerik.com/devtools/maui/controls/autocomplete/overview) on iOS, the auto-correction feature causes unexpected behavior during suggestion selection. Instead of inserting the selected item, iOS auto-correction inserts an auto-completed string, such as "Er". This issue occurs specifically when iOS automatically highlights its auto-correction suggestions. |
| 21 | + |
| 22 | +This knowledge base article also answers the following questions: |
| 23 | +- How to disable iOS auto-correction for RadAutoComplete? |
| 24 | +- Why does incorrect text appear in RadAutoComplete selection on iOS? |
| 25 | +- How to resolve text prediction issues in RadAutoComplete? |
| 26 | + |
| 27 | +## Solution |
| 28 | + |
| 29 | +Disable the iOS auto-correction feature to ensure the correct item is inserted upon selection. The `RadAutoComplete` uses the `RadTextInput` control internally, which inherits from the Microsoft MAUI Entry control. You can set the `IsTextPredictionEnabled` property of the `RadTextInput` to `False` using the `TextInputStyle` property of RadAutoComplete. |
| 30 | + |
| 31 | +1. Define a style for RadTextInput in the `ResourceDictionary`. |
| 32 | +2. Set the `IsTextPredictionEnabled` property to `False` in the style. |
| 33 | +3. Apply the style to the `TextInputStyle` property of RadAutoComplete. |
| 34 | + |
| 35 | +```xaml |
| 36 | +<ContentPage.Resources> |
| 37 | + <ResourceDictionary> |
| 38 | + <Style x:Key="myStyle" TargetType="telerik:RadTextInput"> |
| 39 | + <Setter Property="IsTextPredictionEnabled" Value="False"/> |
| 40 | + </Style> |
| 41 | + </ResourceDictionary> |
| 42 | +</ContentPage.Resources> |
| 43 | + |
| 44 | +<VerticalStackLayout> |
| 45 | + <telerik:RadAutoComplete TextInputStyle="{StaticResource myStyle}" /> |
| 46 | +</VerticalStackLayout> |
| 47 | +``` |
| 48 | + |
| 49 | +This configuration disables text prediction and auto-correction, ensuring the selected item is correctly inserted. |
| 50 | + |
| 51 | +## See Also |
| 52 | + |
| 53 | +- [AutoComplete Overview](https://docs.telerik.com/devtools/maui/controls/autocomplete/overview) |
| 54 | +- [TextInput Documentation](https://docs.telerik.com/devtools/maui/controls/entry/text-input) |
0 commit comments