KEMBAR78
Fix SearchBar IsTextPredictionEnabled false functionality by Shalini-Ashokan · Pull Request #31255 · dotnet/maui · GitHub
Skip to content

Conversation

Shalini-Ashokan
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

Setting IsTextPredictionEnabled=false on SearchBar doesn't disable text prediction on iOS and android platforms.
Text suggestions still appear when typing, despite the property being explicitly set to false.

Root Cause

The ITextInput.IsTextPredictionEnabled interface implementation in SearchBar was hardcoded to true instead of respecting the actual property value, preventing text prediction from being disabled.

Description of Change

Modified the implementation to return the actual IsTextPredictionEnabled property value, allowing platform handlers to correctly apply text prediction settings when the property is set to false.

Validated the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #30961

Output ScreenShot

Before After
30961-Before.mov
30961.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Aug 20, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@Shalini-Ashokan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 20, 2025
@Shalini-Ashokan Shalini-Ashokan marked this pull request as ready for review August 21, 2025 07:02
@Copilot Copilot AI review requested due to automatic review settings August 21, 2025 07:02
@Shalini-Ashokan Shalini-Ashokan requested a review from a team as a code owner August 21, 2025 07:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the SearchBar's IsTextPredictionEnabled property was not functioning correctly. The issue was that the ITextInput interface implementation was hardcoded to always return true, ignoring the actual property value set by developers.

  • Fixed the ITextInput.IsTextPredictionEnabled implementation to return the actual property value
  • Added comprehensive test coverage for the SearchBar IsTextPredictionEnabled functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Controls/src/Core/SearchBar/SearchBar.cs Fixed ITextInput.IsTextPredictionEnabled to return actual property value instead of hardcoded true
src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.cs Added test method to verify IsTextPredictionEnabled property initializes correctly for SearchBar

@jsuarezruiz jsuarezruiz added the area-controls-searchbar SearchBar control label Aug 26, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jfversluis jfversluis changed the base branch from main to inflight/current August 27, 2025 12:19
@jfversluis jfversluis added this to the .NET 9 SR11 milestone Aug 27, 2025
@jfversluis jfversluis merged commit f802ee6 into dotnet:inflight/current Aug 27, 2025
129 checks passed
PureWeen pushed a commit that referenced this pull request Sep 8, 2025
fix the text prediction issue for android

Removed unwanted codes

remove unwanted codes

simplified the fix

Added test case

Remove ui test

Added a device test
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-searchbar SearchBar control community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android, iOS] IsTextPredictionEnabled="False" for SearchBar not working

3 participants