Fixed SearchBar CursorPosition and SelectionLength not updating when typing#34347
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34347Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34347" |
There was a problem hiding this comment.
Pull request overview
Fixes SearchBar.CursorPosition and SelectionLength synchronization across Android, iOS/MacCatalyst, and Windows by wiring native selection/cursor changes back into the MAUI ISearchBar, and by adding mappers to push virtual cursor/selection values to the platform controls.
Changes:
- Add
CursorPosition/SelectionLengthproperty mappers toSearchBarHandlerand platform implementations (Android/iOS/Windows). - Implement native cursor/selection change detection (Android touch/key hooks; iOS delegate selection callback; Windows inner
TextBox.SelectionChanged). - Add regression device tests covering cursor/selection updates while typing/selection changes on each platform.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/src/Handlers/SearchBar/SearchBarHandler.cs | Adds handler property mappings for CursorPosition and SelectionLength. |
| src/Core/src/Handlers/SearchBar/SearchBarHandler.Standard.cs | Adds no-op mapper stubs for non-platform builds. |
| src/Core/src/Handlers/SearchBar/SearchBarHandler.Android.cs | Tracks native selection changes via query editor touch/key hooks; adds mapper methods. |
| src/Core/src/Platform/Android/EditTextExtensions.cs | Adjusts selection setting timing; improves selection-length handling (RTL-safe). |
| src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs | Adds mapper methods and syncs native selection changes back to virtual view via SelectionChanged. |
| src/Core/src/Platform/iOS/MauiSearchBar.cs | Adds selection-change detection on internal search text field via delegate + new SelectionChanged event. |
| src/Core/src/Platform/iOS/SearchBarExtensions.cs | Adds native selection update helpers for SearchBar’s internal UITextField. |
| src/Core/src/Handlers/SearchBar/SearchBarHandler.Windows.cs | Hooks inner TextBox.SelectionChanged and adds mapper methods to push cursor/selection to native. |
| src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.cs | Adds cross-platform regression test for cursor updates after native typing. |
| src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.Android.cs | Adds Android regression tests for cursor/selection updates and MAUI→native cursor mapping. |
| src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.iOS.cs | Adds iOS regression tests for focus-driven cursor updates and selection synchronization. |
| src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.Windows.cs | Adds Windows regression tests for cursor/selection updates via native AutoSuggestBox/inner TextBox. |
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Public API entries for new mapper methods. |
| src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Public API entries for new mapper methods. |
| src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Public API entries for new mapper methods. |
| src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt | Public API entries for new mapper methods. |
d78d0f9 to
8cfc4a1
Compare
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts?
7dc3ad7 to
e02ed4c
Compare
@kubaflo Resolved conflicts. could you please review once. |
🚦 Gate - Test Before and After Fix📊 Expand Full Gate —
|
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
📱 SearchBarHandlerTests (CursorPositionUpdatesAfterSetQuery, SelectionLengthUpdatesWhenTextIsSelectedNatively, CursorPositionSetProgrammaticallyUpdatesNativeCursor, SelectionLengthUpdatesWhenTextIsSelectedViaKeyboard, CursorPositionUpdatesAfterSettingNativeText, CursorPositionUpdatesAfterTypingViaNativeInput, CursorPositionUpdatesWhenSearchBarGainsFocus, CursorPositionDoesNotChangeWhenTextSetProgrammaticallyWithoutFocus, CursorPositionUpdatesWhenRepositionedWithoutTextChange, SelectionLengthAndCursorPositionBothUpdateOnSelection) Category=SearchBar |
✅ FAIL — 250s | ✅ PASS — 354s |
🔴 Without fix — 📱 SearchBarHandlerTests (CursorPositionUpdatesAfterSetQuery, SelectionLengthUpdatesWhenTextIsSelectedNatively, CursorPositionSetProgrammaticallyUpdatesNativeCursor, SelectionLengthUpdatesWhenTextIsSelectedViaKeyboard, CursorPositionUpdatesAfterSettingNativeText, CursorPositionUpdatesAfterTypingViaNativeInput, CursorPositionUpdatesWhenSearchBarGainsFocus, CursorPositionDoesNotChangeWhenTextSetProgrammaticallyWithoutFocus, CursorPositionUpdatesWhenRepositionedWithoutTextChange, SelectionLengthAndCursorPositionBothUpdateOnSelection): FAIL ✅ · 250s
Determining projects to restore...
Restored /home/vsts/work/1/s/src/TestUtils/src/DeviceTests/TestUtils.DeviceTests.csproj (in 6.34 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj (in 6.36 sec).
Restored /home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 120 ms).
Restored /home/vsts/work/1/s/src/Essentials/src/Essentials.csproj (in 69 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.csproj (in 869 ms).
Restored /home/vsts/work/1/s/src/Core/tests/DeviceTests.Shared/Core.DeviceTests.Shared.csproj (in 39 ms).
Restored /home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj (in 755 ms).
Restored /home/vsts/work/1/s/src/Core/src/Core.csproj (in 143 ms).
Restored /home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 58 ms).
Restored /home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 39 ms).
Restored /home/vsts/work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 28 ms).
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13752714
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Release/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13752714
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Release/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13752714
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Release/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Release/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13752714
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Release/net10.0-android36.0/Microsoft.Maui.Controls.dll
TestUtils.DeviceTests -> /home/vsts/work/1/s/artifacts/bin/TestUtils.DeviceTests/Release/net10.0-android/Microsoft.Maui.TestUtils.DeviceTests.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13752714
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Release/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
TestUtils.DeviceTests.Runners -> /home/vsts/work/1/s/artifacts/bin/TestUtils.DeviceTests.Runners/Release/net10.0-android/Microsoft.Maui.TestUtils.DeviceTests.Runners.dll
Core.DeviceTests.Shared -> /home/vsts/work/1/s/artifacts/bin/Core.DeviceTests.Shared/Release/net10.0-android/Microsoft.Maui.DeviceTests.Shared.dll
TestUtils.DeviceTests.Runners.SourceGen -> /home/vsts/work/1/s/artifacts/bin/TestUtils.DeviceTests.Runners.SourceGen/Release/netstandard2.0/Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen.dll
/home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.Android.cs(56,13): error CS1061: 'IPlatformViewHandler' does not contain a definition for 'OnQueryEditorSelectionChanged' and no accessible extension method 'OnQueryEditorSelectionChanged' accepting a first argument of type 'IPlatformViewHandler' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.Android.cs(81,22): error CS0117: 'SearchBarHandler' does not contain a definition for 'MapCursorPosition' [/home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.Android.cs(56,13): error CS1061: 'IPlatformViewHandler' does not contain a definition for 'OnQueryEditorSelectionChanged' and no accessible extension method 'OnQueryEditorSelectionChanged' accepting a first argument of type 'IPlatformViewHandler' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/SearchBar/SearchBarHandlerTests.Android.cs(81,22): error CS0117: 'SearchBarHandler' does not contain a definition for 'MapCursorPosition' [/home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-android]
0 Warning(s)
2 Error(s)
Time Elapsed 00:03:54.94
🟢 With fix — 📱 SearchBarHandlerTests (CursorPositionUpdatesAfterSetQuery, SelectionLengthUpdatesWhenTextIsSelectedNatively, CursorPositionSetProgrammaticallyUpdatesNativeCursor, SelectionLengthUpdatesWhenTextIsSelectedViaKeyboard, CursorPositionUpdatesAfterSettingNativeText, CursorPositionUpdatesAfterTypingViaNativeInput, CursorPositionUpdatesWhenSearchBarGainsFocus, CursorPositionDoesNotChangeWhenTextSetProgrammaticallyWithoutFocus, CursorPositionUpdatesWhenRepositionedWithoutTextChange, SelectionLengthAndCursorPositionBothUpdateOnSelection): PASS ✅ · 354s
(truncated to last 15,000 chars)
tus=succeeded, bytes_downloaded=41442, total_bytes=41442, retry[count=0, next_retry=n/a])
04-06 07:37:49.996 8303 8534 I Finsky:background: [619] DSC::L: Update all listeners for download <8:RUNNING:100%[100%]> in group com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA
04-06 07:37:49.996 8303 8534 I Finsky:background: [619] DSC::L: Updating listener DownloadServiceManagerListener::sbq@8365dbe for download <8:RUNNING:100%[100%]>
04-06 07:37:49.996 8303 8534 I Finsky:background: [619] DSC::L: Updating listener ueb@ea9fe1f for download <8:RUNNING:100%[100%]>
04-06 07:37:49.996 8303 8534 I Finsky:background: [619] DSC::L: Updating listener DownloadServiceManagerListener::amsw@a77d1b1 for download <8:RUNNING:100%[100%]>
04-06 07:37:49.996 8303 8534 I Finsky:background: [619] DS: Received onProgress request_id=8
04-06 07:37:49.996 8303 8534 I Finsky:background: [619] RM: receive resource status onProgress download_request_id=8, group_id=config.xxhdpi reason: rapid_auto_update isid: dOfB290XRQKXtEibeZZXGA, status_code=RESOURCE_STATUS_IN_PROGRESS, legacy_status_code=192, size: 1018022/1018022
04-06 07:37:50.010 8303 8341 I Finsky:background: [587] RM: getStatus resourceRequestId=a13d6dc5-22ac-4f39-a54b-74ec9af73949 requestId=8 package=com.google.android.googlequicksearchbox artifact=config.xxhdpi isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.010 8303 8341 I Finsky:background: [587] DSC: reviveDownload(8)
04-06 07:37:50.011 8303 8341 I Finsky:background: [587] DS: reviveDownload(request_id=8)
04-06 07:37:50.011 8303 8534 I Finsky:background: [619] DS::IDC: updateWith: <8:RUNNING:100%[100%]>
04-06 07:37:50.012 8303 8534 I Finsky:background: [619] DS: DS: onReviveDownload(request_id=8, files_to_download=[config.xxhdpi(size:1018022)], context[group_id=com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA], display_data[invisible=true, title=Required app update], network_restrictions=ANY_NETWORK status=running, bytes_downloaded=1018022, total_bytes=1018022, retry[count=0, next_retry=n/a])
04-06 07:37:50.024 8303 8303 I Finsky:background: [2] RF: onProgress request_id=8 isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.024 8303 8303 I Finsky:background: [2] RF: resourceStatus for request_id=8 group=com.google.android.googlequicksearchbox artifact=config.xxhdpi collectedBytes= 1018022 / 1018022
04-06 07:37:50.024 8303 8303 I Finsky:background: [2] RF: Group=com.google.android.googlequicksearchbox totalBytesDownloaded= 1059464 / 68719199 for 3 artifacts
04-06 07:37:50.025 8303 8303 I Finsky:background: [2] RF: Preventing total bytes update to listeners
04-06 07:37:50.033 8303 8534 I Finsky:background: [619] DS: Decremented runningDownloadsCount to: 1
04-06 07:37:50.033 8303 8534 I Finsky:background: [619] DS: Current runningDownloadsCount: 1, maxSimultaneousDownloads: 4
04-06 07:37:50.041 8303 8534 I Finsky:background: [619] DSC::L: Update all listeners for download <8:SUCCEEDED> in group com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.042 8303 8534 I Finsky:background: [619] DSC::L: Updating listener DownloadServiceManagerListener::sbq@8365dbe for download <8:SUCCEEDED>
04-06 07:37:50.052 8303 8534 I Finsky:background: [619] DSC::L: Updating listener ueb@ea9fe1f for download <8:SUCCEEDED>
04-06 07:37:50.052 8303 8534 I Finsky:background: [619] DSC::L: Updating listener DownloadServiceManagerListener::amsw@a77d1b1 for download <8:SUCCEEDED>
04-06 07:37:50.057 8303 8534 I Finsky:background: [619] RM: receive resource status onSuccess config.xxhdpi reason: rapid_auto_update isid: dOfB290XRQKXtEibeZZXGA, 3, 200, size: 1018022/1018022
04-06 07:37:50.059 8303 8534 I Finsky:background: [619] DS::IDC: updateWith: <8:SUCCEEDED>
04-06 07:37:50.060 8303 8336 I Finsky:background: [585] RM: getStatus resourceRequestId=a13d6dc5-22ac-4f39-a54b-74ec9af73949 requestId=8 package=com.google.android.googlequicksearchbox artifact=config.xxhdpi isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.060 8303 8336 I Finsky:background: [585] DSC: reviveDownload(8)
04-06 07:37:50.061 8303 8336 I Finsky:background: [585] DS: reviveDownload(request_id=8)
04-06 07:37:50.063 8303 8534 I Finsky:background: [619] DS: DS: onReviveDownload(request_id=8, files_to_download=[config.xxhdpi(size:1018022)], context[group_id=com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA], display_data[invisible=true, title=Required app update], network_restrictions=ANY_NETWORK status=succeeded, bytes_downloaded=1018022, total_bytes=1018022, retry[count=0, next_retry=n/a])
04-06 07:37:50.066 8303 9006 I Finsky:background: [652] DU: Stored data usage stats for package com.google.android.googlequicksearchbox; completed bytes: 1018022.
04-06 07:37:50.072 8303 8303 I Finsky:background: [2] RF: onResourceSuccess request_id=8 isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.073 8303 8303 I Finsky:background: [2] RF: resourceStatus for request_id=8 group=com.google.android.googlequicksearchbox artifact=config.xxhdpi collectedBytes= 1018022 / 1018022
04-06 07:37:50.073 8303 8303 I Finsky:background: [2] RF: Group=com.google.android.googlequicksearchbox totalBytesDownloaded= 1059464 / 68719199 for 3 artifacts
04-06 07:37:50.073 8303 8303 I Finsky:background: [2] bytesCompleted/bytesTotal/ratio = 1059464 / 68719199 / 0.015417
04-06 07:37:50.073 8303 8303 I Finsky:background: [2] RF: onSuccess request_id=8 isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.073 8303 8303 I Finsky:background: [2] RF: resourceStatus for request_id=8 group=com.google.android.googlequicksearchbox artifact=config.xxhdpi collectedBytes= 1018022 / 1018022
04-06 07:37:50.073 8303 8303 I Finsky:background: [2] RF: Group=com.google.android.googlequicksearchbox totalBytesDownloaded= 1059464 / 68719199 for 3 artifacts
04-06 07:37:50.075 8303 8343 I Finsky:background: [589] IV2: onTaskProgress com.google.android.googlequicksearchbox[iid:0] [isid:dOfB290XRQKXtEibeZZXGA] status:RESOURCE_FETCH_PROGRESS, size: 1059464/68719199
04-06 07:37:50.078 8303 8337 I Finsky:background: [586] RF: starting postprocessing for config.xxhdpi
04-06 07:37:50.079 8303 8342 I Finsky:background: [588] RF::PP-Decompress: starting to decompress for com.google.android.googlequicksearchbox[iid:0] [isid:dOfB290XRQKXtEibeZZXGA] [tid: 1000000000].
04-06 07:37:50.079 8303 8342 I Finsky:background: [588] RF::PP-Copy: starting to copy for com.google.android.googlequicksearchbox[iid:0] [isid:dOfB290XRQKXtEibeZZXGA] [tid: 1000000000]
04-06 07:37:50.080 8303 8978 I Finsky:background: [632] RF::PP-Copy: Starting copy of config.xxhdpi
04-06 07:37:50.080 8303 8978 I Finsky:background: [632] RF::PP-Copy: OutputStream opened for config.xxhdpi
04-06 07:37:50.080 8303 8978 I Finsky:background: [632] RF::PP-Copy: Start copying from input stream for config.xxhdpi
04-06 07:37:50.081 8303 8346 I Finsky:background: [592] IQ: Notifying installation update. [Package:com.google.android.googlequicksearchbox, isid:dOfB290XRQKXtEibeZZXGA] state:DOWNLOADING, status=DOWNLOADING, status_code=0, reason=rapid_auto_update, tsc=PT3.46S, attempt=0
04-06 07:37:50.119 8303 8303 I Finsky:background: [2] PIM: Ignore install package event for: com.google.android.googlequicksearchbox, isid: dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.123 8190 8190 I Finsky : [2] DL: Data loader session turned off due to Incremental install not requested: com.google.android.googlequicksearchbox
04-06 07:37:50.127 8303 8343 I Finsky:background: [589] IV2: onTaskProgress com.google.android.googlequicksearchbox[iid:0] [isid:dOfB290XRQKXtEibeZZXGA] status:RESOURCE_FETCH_PROGRESS, size: 1059464/68719199
04-06 07:37:50.138 8190 8190 I Finsky : [2] IQ::HLD: if pauseAppUpdates is called now, it must wait for these ongoing installs: [[Package:com.google.android.googlequicksearchbox, isid:dOfB290XRQKXtEibeZZXGA] state:DOWNLOADING]
04-06 07:37:50.148 8303 8346 I Finsky:background: [592] IQ: Notifying installation update. [Package:com.google.android.googlequicksearchbox, isid:dOfB290XRQKXtEibeZZXGA] state:DOWNLOADING, status=DOWNLOADING, status_code=0, reason=rapid_auto_update, tsc=PT3.527S, attempt=0
04-06 07:37:50.176 8303 8303 I Finsky:background: [2] PIM: Ignore install package event for: com.google.android.googlequicksearchbox, isid: dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.181 8190 8190 I Finsky : [2] DL: Data loader session turned off due to Incremental install not requested: com.google.android.googlequicksearchbox
04-06 07:37:50.182 8190 8190 I Finsky : [2] IQ::HLD: if pauseAppUpdates is called now, it must wait for these ongoing installs: [[Package:com.google.android.googlequicksearchbox, isid:dOfB290XRQKXtEibeZZXGA] state:DOWNLOADING]
04-06 07:37:50.573 8303 8978 I Finsky:background: [632] RF::PP-Copy: Finished copying from input stream for config.xxhdpi
04-06 07:37:50.590 8303 8342 I Finsky:background: [588] RF::PP-Verify: starting to verify for com.google.android.googlequicksearchbox[iid:0] [isid:dOfB290XRQKXtEibeZZXGA] [tid: 1000000000].
04-06 07:37:50.599 8303 8333 I Finsky:background: [582] RM: remove resources for request a13d6dc5-22ac-4f39-a54b-74ec9af73949
04-06 07:37:50.599 8303 8336 I Finsky:background: [585] RM: remove resourceRequestId=a13d6dc5-22ac-4f39-a54b-74ec9af73949 requestId=8 package=com.google.android.googlequicksearchbox artifact=config.xxhdpi isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.599 8303 8336 I Finsky:background: [585] DSC: remove(8)
04-06 07:37:50.601 8303 8336 I Finsky:background: [585] DS: remove(request_id=8)
04-06 07:37:50.614 8303 8534 I Finsky:background: [619] DS: DS: onRemove(request_id=8, files_to_download=[config.xxhdpi(size:1018022)], context[group_id=com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA], display_data[invisible=true, title=Required app update], network_restrictions=ANY_NETWORK status=succeeded, bytes_downloaded=1018022, total_bytes=1018022, retry[count=0, next_retry=n/a])
04-06 07:37:50.631 1573 1604 I PeriodicStatsRunner: PeriodicStatsRunner.call():180 call()
04-06 07:37:50.631 1573 1604 I PeriodicStatsRunner: PeriodicStatsRunner.call():184 No submit PeriodicStats since input started.
04-06 07:37:50.819 8303 8534 I Finsky:background: [619] DSC::L: Update all listeners for download <6:RUNNING:3%[3%]> in group com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.819 8303 8534 I Finsky:background: [619] DSC::L: Updating listener DownloadServiceManagerListener::sbq@8365dbe for download <6:RUNNING:3%[3%]>
04-06 07:37:50.819 8303 8534 I Finsky:background: [619] DSC::L: Updating listener ueb@ea9fe1f for download <6:RUNNING:3%[3%]>
04-06 07:37:50.819 8303 8534 I Finsky:background: [619] DSC::L: Updating listener DownloadServiceManagerListener::amsw@a77d1b1 for download <6:RUNNING:3%[3%]>
04-06 07:37:50.819 8303 8534 I Finsky:background: [619] DS: Received onProgress request_id=6
04-06 07:37:50.819 8303 8534 I Finsky:background: [619] RM: receive resource status onProgress download_request_id=6, group_id=com.google.android.googlequicksearchbox.apk reason: rapid_auto_update isid: dOfB290XRQKXtEibeZZXGA, status_code=RESOURCE_STATUS_IN_PROGRESS, legacy_status_code=192, size: 2555888/67659735
04-06 07:37:50.820 8303 8534 I Finsky:background: [619] DS::IDC: updateWith: <6:RUNNING:3%[3%]>
04-06 07:37:50.826 8303 8341 I Finsky:background: [587] RM: getStatus resourceRequestId=f4addc6b-f8a0-450c-9633-a05ac288448e requestId=6 package=com.google.android.googlequicksearchbox artifact=com.google.android.googlequicksearchbox.apk isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.826 8303 8341 I Finsky:background: [587] DSC: reviveDownload(6)
04-06 07:37:50.827 8303 8341 I Finsky:background: [587] DS: reviveDownload(request_id=6)
04-06 07:37:50.833 8303 8534 I Finsky:background: [619] DS: DS: onReviveDownload(request_id=6, files_to_download=[com.google.android.googlequicksearchbox.apk(size:67659735)], context[group_id=com.google.android.googlequicksearchbox:dOfB290XRQKXtEibeZZXGA], display_data[invisible=true, title=Required app update], network_restrictions=ANY_NETWORK status=running, bytes_downloaded=2555888, total_bytes=67659735, retry[count=0, next_retry=n/a])
04-06 07:37:50.842 8303 8303 I Finsky:background: [2] RF: onProgress request_id=6 isid=dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.842 8303 8303 I Finsky:background: [2] RF: resourceStatus for request_id=6 group=com.google.android.googlequicksearchbox artifact=com.google.android.googlequicksearchbox.apk collectedBytes= 2555888 / 67659735
04-06 07:37:50.842 8303 8303 I Finsky:background: [2] RF: Group=com.google.android.googlequicksearchbox totalBytesDownloaded= 3615352 / 68719199 for 3 artifacts
04-06 07:37:50.843 8303 8303 I Finsky:background: [2] Updated time lastBroadcast=2026-04-06T12:37:48.807Z current=2026-04-06T12:37:50.842Z
04-06 07:37:50.843 8303 8303 I Finsky:background: [2] bytesCompleted/bytesTotal/ratio = 3615352 / 68719199 / 0.052611
04-06 07:37:50.844 8303 8343 I Finsky:background: [589] IV2: onTaskProgress com.google.android.googlequicksearchbox[iid:0] [isid:dOfB290XRQKXtEibeZZXGA] status:RESOURCE_FETCH_PROGRESS, size: 3615352/68719199
04-06 07:37:50.846 8303 8346 I Finsky:background: [592] IQ: Notifying installation update. [Package:com.google.android.googlequicksearchbox, isid:dOfB290XRQKXtEibeZZXGA] state:DOWNLOADING, status=DOWNLOADING, status_code=0, reason=rapid_auto_update, tsc=PT4.225S, attempt=0
04-06 07:37:50.871 8303 8303 I Finsky:background: [2] PIM: Ignore install package event for: com.google.android.googlequicksearchbox, isid: dOfB290XRQKXtEibeZZXGA
04-06 07:37:50.874 8190 8190 I Finsky : [2] DL: Data loader session turned off due to Incremental install not requested: com.google.android.googlequicksearchbox
04-06 07:37:50.878 8190 8190 I Finsky : [2] IQ::HLD: if pauseAppUpdates is called now, it must wait for these ongoing installs: [[Package:com.google.android.googlequicksearchbox, isid:dOfB290XRQKXtEibeZZXGA] state:DOWNLOADING]
�[40m�[32minfo�[39m�[22m�[49m: Attempting to remove apk 'com.microsoft.maui.core.devicetests'..
�[40m�[37mdbug�[39m�[22m�[49m: Executing command: '/home/vsts/.nuget/packages/microsoft.dotnet.xharness.cli/11.0.0-prerelease.26107.1/runtimes/any/native/adb/linux/adb -s emulator-5554 uninstall com.microsoft.maui.core.devicetests'
�[40m�[32minfo�[39m�[22m�[49m: Successfully uninstalled com.microsoft.maui.core.devicetests
XHarness exit code: 0
Tests completed successfully
📁 Fix files reverted (9 files)
eng/pipelines/ci-copilot.ymlsrc/Core/src/Handlers/SearchBar/SearchBarHandler.Android.cssrc/Core/src/Handlers/SearchBar/SearchBarHandler.Standard.cssrc/Core/src/Handlers/SearchBar/SearchBarHandler.Windows.cssrc/Core/src/Handlers/SearchBar/SearchBarHandler.cssrc/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cssrc/Core/src/Platform/Android/EditTextExtensions.cssrc/Core/src/Platform/iOS/MauiSearchBar.cssrc/Core/src/Platform/iOS/SearchBarExtensions.cs
🤖 AI Summary📊 Expand Full Review —
|
| File | Role |
|---|---|
SearchBarHandler.Android.cs |
Three-hook cursor tracking + MapCursorPosition/MapSelectionLength |
SearchBarHandler.iOS.cs |
SelectionChanged subscription + MapCursorPosition/MapSelectionLength |
SearchBarHandler.Windows.cs |
Inner TextBox.SelectionChanged + MapCursorPosition/MapSelectionLength |
SearchBarHandler.Standard.cs |
Empty fallback mappers |
SearchBarHandler.cs |
PropertyMapper entries for CursorPosition/SelectionLength |
EditTextExtensions.cs |
Post()-deferred SetSelection + clamping |
MauiSearchBar.cs |
SearchEditorDelegate (iOS) with DidChangeSelection |
SearchBarExtensions.cs |
UpdateCursorPosition/UpdateSelectionLength for iOS UITextField |
Test Files
| File | Platform |
|---|---|
SearchBarHandlerTests.Android.cs |
Android |
SearchBarHandlerTests.iOS.cs |
iOS |
SearchBarHandlerTests.Windows.cs |
Windows |
SearchBarHandlerTests.cs |
Shared |
Test Type
Device Tests — src/Core/tests/DeviceTests/Handlers/SearchBar/
Run command: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform android -TestFilter "Category=SearchBar"
Prior Agent Review Summary
- Gate: ❌ FAILED (prior session — false positive; baseline detected unrelated PublicAPI entries as fix files)
- Gate (current): ✅ PASSED
- Try-Fix: Attempt 2 (ViewTreeObserver.IOnPreDrawListener + KeyListener) passed; 1 file changed
- Selected Fix (prior): Attempt 2 — simpler than PR's 3-hook approach
- PR author response: Addressed all 8 inline comments; kept original 3-hook approach (not Attempt 2)
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #34347 | Three-hook Android (OnQueryTextChange + TouchListener + KeyListener) + Post() deferred reads; iOS SearchEditorDelegate DidChangeSelection; Windows inner TextBox.SelectionChanged | ✅ PASSED (Gate) | 8 impl + 4 test | All prior review comments addressed |
🔧 Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix (claude-opus-4.6) | ISpanWatcher + TextWatcher on Editable buffer — monitors Selection span changes at text-buffer level | ✅ PASS (209 passed) | 5 files | Different from PR's 3 event hooks; unified mechanism; no Post() race |
| 2 | try-fix (claude-sonnet-4.6) | ArrowKeyMovementMethod subclass intercepts OnKeyUp + OnQueryTextChange for typing | ✅ PASS (209 passed) | 1 file | 2-hook approach; simpler than PR |
| 3 | try-fix (gpt-5.3-codex) | Focus-scoped polling loop reading SelectionStart/End periodically while focused | ❌ FAIL | 1 file | 3 tests failed — polling interval missed deferred SearchView timing |
| 4 | try-fix (gpt-5.4) | ITextWatcher.AfterTextChanged + ActionMode callbacks (gemini unavailable, gpt-5.4 used) | ❌ FAIL | 2 files | Keyboard selection via Shift+Arrow missed by ActionMode |
| PR | PR #34347 | Three-hook Android (OnQueryTextChange + TouchListener + KeyListener) + Post() deferred reads; iOS SearchEditorDelegate DidChangeSelection; Windows inner TextBox.SelectionChanged | ✅ PASSED (Gate) | 8 impl + 4 test | All prior review comments addressed |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | Yes | AccessibilityDelegate on QueryEditor — override sendAccessibilityEvent to detect TYPE_VIEW_TEXT_SELECTION_CHANGED (novel, but complex; 2 passing simpler alternatives exist) |
| claude-sonnet-4.6 | 2 | No | NO NEW IDEAS |
| gpt-5.3-codex | 2 | Yes | SearchAutoComplete subclass overriding OnSelectionChanged — already attempted in prior session via JNI, fails on AppCompatAutoCompleteTextView subclass |
| gpt-5.4 | 2 | Yes | Same SearchAutoComplete subclass idea as gpt-5.3-codex — already known to fail |
Exhausted: Yes — all novel ideas are either already tried, known to fail, or more complex than existing passing alternatives.
Selected Fix: Attempt 2 (ArrowKeyMovementMethod + OnQueryTextChange) — simplest passing approach (1 file, 2 hooks vs PR's 3); OR PR's fix (fully validated Gate, multi-platform, all prior comments addressed). See analysis in Report.
📋 Report — Final Recommendation
✅ Final Recommendation: APPROVE
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Issue #30779, 8 impl + 4 test files, all platforms (Android, iOS, MacCatalyst, Windows) |
| Gate | ✅ PASSED | android — all SearchBar device tests pass |
| Try-Fix | ✅ COMPLETE | 4 attempts; 2 passing (Attempt 1 ISpanWatcher, Attempt 2 ArrowKeyMovementMethod); 2 failed; cross-pollination exhausted |
| Report | ✅ COMPLETE |
Summary
PR #34347 fixes SearchBar.CursorPosition and SelectionLength not syncing on Android, iOS, MacCatalyst, and Windows (issue #30779). The Gate passes. All 8 prior inline review comments have been addressed. Two independent alternative approaches were found for Android — both pass tests — but the PR's fix is selected as the best overall solution because it explicitly covers all three input modalities (typing, touch-repositioning, keyboard navigation) and spans all four platforms.
Root Cause
Android: QueryEditor is SearchView.SearchAutoComplete (not MauiAppCompatEditText), so there is no SelectionChanged event. No mechanism tracked cursor/selection from typing, tap-repositioning, or keyboard navigation.
iOS/MacCatalyst: TextFieldEditingChanged updated VirtualView.Text but never read back cursor/selection from the native UITextField.
Windows: AutoSuggestBox wraps an inner TextBox; handler didn't subscribe to TextBox.SelectionChanged.
Try-Fix Analysis
| # | Approach | Result | Robustness vs PR |
|---|---|---|---|
| 1 | ISpanWatcher + TextWatcher on Editable buffer | ✅ PASS | Good — Editable-level span watch covers all cases, but 5 files vs PR's focused handler-level change |
| 2 | ArrowKeyMovementMethod subclass + OnQueryTextChange | ✅ PASS | Partial — covers typing + key nav, but misses touch-based cursor repositioning (tapping within text) |
| 3 | Focus-scoped polling | ❌ FAIL | N/A — timing unreliable |
| 4 | ITextWatcher + ActionMode callbacks | ❌ FAIL | N/A — keyboard Shift+Arrow selection missed |
| PR | 3-hook (OnQueryTextChange + TouchListener + KeyListener) | ✅ PASS (Gate) | Most complete — explicitly handles all three input modalities |
Selected Fix: PR — Attempt 2 (ArrowKeyMovementMethod) is the simplest Android-only alternative but doesn't cover touch cursor repositioning. The PR's three-hook approach is more defensively correct, covers all input modalities, and is the only solution that also addresses iOS/MacCatalyst and Windows.
Fix Quality
The PR's implementation is sound across all platforms:
Android:
- Three hooks correctly cover all cursor-move scenarios: text change (typing), touch ACTION_UP (tap-to-reposition), and key ACTION_UP (keyboard navigation)
Post()deferral inOnQueryEditorSelectionChangedhandles SearchView's internal timing (setQuery calls setText before setSelection)EditTextExtensions.UpdateCursorSelectioncorrectly clamps start/end inside thePost()callback to avoid out-of-rangeSetSelectionif text changes between scheduling and executionMath.Abs()inGetSelectedTextLength()correctly handles RTL selections
iOS/MacCatalyst:
SearchEditorDelegatewithDidChangeSelectionmirrors the Entry handler patternSelectionChangedevent subscription on the proxy correctly integrates with existing iOS SearchBar lifecycleMapCursorPosition/MapSelectionLengthcorrectly delegate toSearchBarExtensionsfor UITextField manipulation
Windows:
GetFirstDescendant<TextBox>()inOnLoadedcorrectly finds inner TextBox- Old
_queryTextBox.SelectionChangedsubscription is unsubscribed before reassigning on repeatedOnLoadedcalls (prevents duplicate handlers) DisconnectHandlercorrectly unsubscribes and nulls_queryTextBox
Code quality:
MapCursorPosition/MapSelectionLengthareinternalwith comment "make public in .net 11" — correct API stagingPropertyMapperentries added inSearchBarHandler.cs- All 8 prior inline review comments addressed (encoding BOM, unused
using, null! operator, comment direction, duplicate subscriptions) - Device tests comprehensively cover the fix:
CursorPositionUpdatesAfterSetQuery,SelectionLengthUpdatesWhenTextIsSelectedNatively,CursorPositionSetProgrammatically,SelectionLengthUpdatesViaKeyboard,CursorPositionDoesntResetWhenNativeTextValueChanges,CursorPositionUpdatesAfterTypingViaNativeInput
Notes
No blocking concerns remain. The PR is ready to merge.
|
Validated and addressed AI summary. |
|
|
…typing Rebased PR dotnet#34347 onto current main to show correct number of changed files. Original author: Dhivya-SF4094 Fixes dotnet#30779 Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolved conflicts. Could you please review once. |
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
…typing (#34347) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> SearchBar.CursorPosition and SelectionLength properties don't work correctly. **Android:** QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates. **iOS / MacCatalyst:** The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state. **Windows:** AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView. **Android:** - Added QueryEditorTouchListener to read the cursor position on ACTION_UP. - Added QueryEditorKeyListener to read the cursor position on key ACTION_UP. - OnQueryTextChange now invokes OnQueryEditorSelectionChanged(), which posts a deferred read of GetCursorPosition() and GetSelectedTextLength() - Implemented MapCursorPosition and MapSelectionLength mappers that delegate to QueryEditor.UpdateCursorPosition and QueryEditor.UpdateSelectionLength. - Updated EditTextExtensions.UpdateCursorSelection to wrap SetSelection in a Post() when the control is focused, preventing race conditions with SearchView.setQuery(). - Updated GetSelectedTextLength() to use Math.Abs() to correctly handle RTL selections. - **iOS / MacCatalyst:** - Added property mappers to synchronize cursor and selection values from the VirtualView to the platform editor. These mappers ensure that when CursorPosition or SelectionLength changes on the SearchBar, the corresponding values are updated on the underlying UITextField. - Introduced SearchEditorDelegate (UITextFieldDelegate) with DidChangeSelection override to detect cursor repositioning and selection changes. - In WillMoveToWindow, assign the delegate when attached to the window and clear it when removed. - Handler proxy subscribes to platformView.SelectionChanged → OnSelectionChanged, following the pattern used in EntryHandler.iOS. - Added MapCursorPosition and MapSelectionLength to update the native editor using SetTextRange(). - **Windows:** - In the OnGotFocus handler (after PlatformView is loaded), locate the inner TextBox using GetFirstDescendant<TextBox>(). - Subscribe to TextBox.SelectionChanged. - OnPlatformSelectionChanged reads _queryTextBox.GetCursorPosition() and _queryTextBox.SelectionLength and syncs them to VirtualView. - DisconnectHandler now unsubscribes from the event and clears _queryTextBox. - Added MapCursorPosition and MapSelectionLength that delegate to _queryTextBox.UpdateCursorPosition and _queryTextBox.UpdateSelectionLength. - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #30779 | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/8a62a1b1-cfab-4e89-a4a6-07094b62ba19"> | <video src="https://github.com/user-attachments/assets/275fa165-59ed-4e98-b45c-2b445789ee2e"> | --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…typing (#34347) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> SearchBar.CursorPosition and SelectionLength properties don't work correctly. **Android:** QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates. **iOS / MacCatalyst:** The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state. **Windows:** AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView. **Android:** - Added QueryEditorTouchListener to read the cursor position on ACTION_UP. - Added QueryEditorKeyListener to read the cursor position on key ACTION_UP. - OnQueryTextChange now invokes OnQueryEditorSelectionChanged(), which posts a deferred read of GetCursorPosition() and GetSelectedTextLength() - Implemented MapCursorPosition and MapSelectionLength mappers that delegate to QueryEditor.UpdateCursorPosition and QueryEditor.UpdateSelectionLength. - Updated EditTextExtensions.UpdateCursorSelection to wrap SetSelection in a Post() when the control is focused, preventing race conditions with SearchView.setQuery(). - Updated GetSelectedTextLength() to use Math.Abs() to correctly handle RTL selections. - **iOS / MacCatalyst:** - Added property mappers to synchronize cursor and selection values from the VirtualView to the platform editor. These mappers ensure that when CursorPosition or SelectionLength changes on the SearchBar, the corresponding values are updated on the underlying UITextField. - Introduced SearchEditorDelegate (UITextFieldDelegate) with DidChangeSelection override to detect cursor repositioning and selection changes. - In WillMoveToWindow, assign the delegate when attached to the window and clear it when removed. - Handler proxy subscribes to platformView.SelectionChanged → OnSelectionChanged, following the pattern used in EntryHandler.iOS. - Added MapCursorPosition and MapSelectionLength to update the native editor using SetTextRange(). - **Windows:** - In the OnGotFocus handler (after PlatformView is loaded), locate the inner TextBox using GetFirstDescendant<TextBox>(). - Subscribe to TextBox.SelectionChanged. - OnPlatformSelectionChanged reads _queryTextBox.GetCursorPosition() and _queryTextBox.SelectionLength and syncs them to VirtualView. - DisconnectHandler now unsubscribes from the event and clears _queryTextBox. - Added MapCursorPosition and MapSelectionLength that delegate to _queryTextBox.UpdateCursorPosition and _queryTextBox.UpdateSelectionLength. - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #30779 | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/8a62a1b1-cfab-4e89-a4a6-07094b62ba19"> | <video src="https://github.com/user-attachments/assets/275fa165-59ed-4e98-b45c-2b445789ee2e"> | --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…typing (dotnet#34347) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> SearchBar.CursorPosition and SelectionLength properties don't work correctly. **Android:** QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates. **iOS / MacCatalyst:** The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state. **Windows:** AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView. **Android:** - Added QueryEditorTouchListener to read the cursor position on ACTION_UP. - Added QueryEditorKeyListener to read the cursor position on key ACTION_UP. - OnQueryTextChange now invokes OnQueryEditorSelectionChanged(), which posts a deferred read of GetCursorPosition() and GetSelectedTextLength() - Implemented MapCursorPosition and MapSelectionLength mappers that delegate to QueryEditor.UpdateCursorPosition and QueryEditor.UpdateSelectionLength. - Updated EditTextExtensions.UpdateCursorSelection to wrap SetSelection in a Post() when the control is focused, preventing race conditions with SearchView.setQuery(). - Updated GetSelectedTextLength() to use Math.Abs() to correctly handle RTL selections. - **iOS / MacCatalyst:** - Added property mappers to synchronize cursor and selection values from the VirtualView to the platform editor. These mappers ensure that when CursorPosition or SelectionLength changes on the SearchBar, the corresponding values are updated on the underlying UITextField. - Introduced SearchEditorDelegate (UITextFieldDelegate) with DidChangeSelection override to detect cursor repositioning and selection changes. - In WillMoveToWindow, assign the delegate when attached to the window and clear it when removed. - Handler proxy subscribes to platformView.SelectionChanged → OnSelectionChanged, following the pattern used in EntryHandler.iOS. - Added MapCursorPosition and MapSelectionLength to update the native editor using SetTextRange(). - **Windows:** - In the OnGotFocus handler (after PlatformView is loaded), locate the inner TextBox using GetFirstDescendant<TextBox>(). - Subscribe to TextBox.SelectionChanged. - OnPlatformSelectionChanged reads _queryTextBox.GetCursorPosition() and _queryTextBox.SelectionLength and syncs them to VirtualView. - DisconnectHandler now unsubscribes from the event and clears _queryTextBox. - Added MapCursorPosition and MapSelectionLength that delegate to _queryTextBox.UpdateCursorPosition and _queryTextBox.UpdateSelectionLength. - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes dotnet#30779 | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/8a62a1b1-cfab-4e89-a4a6-07094b62ba19"> | <video src="https://github.com/user-attachments/assets/275fa165-59ed-4e98-b45c-2b445789ee2e"> | --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…typing (#34347) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> SearchBar.CursorPosition and SelectionLength properties don't work correctly. **Android:** QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates. **iOS / MacCatalyst:** The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state. **Windows:** AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView. **Android:** - Added QueryEditorTouchListener to read the cursor position on ACTION_UP. - Added QueryEditorKeyListener to read the cursor position on key ACTION_UP. - OnQueryTextChange now invokes OnQueryEditorSelectionChanged(), which posts a deferred read of GetCursorPosition() and GetSelectedTextLength() - Implemented MapCursorPosition and MapSelectionLength mappers that delegate to QueryEditor.UpdateCursorPosition and QueryEditor.UpdateSelectionLength. - Updated EditTextExtensions.UpdateCursorSelection to wrap SetSelection in a Post() when the control is focused, preventing race conditions with SearchView.setQuery(). - Updated GetSelectedTextLength() to use Math.Abs() to correctly handle RTL selections. - **iOS / MacCatalyst:** - Added property mappers to synchronize cursor and selection values from the VirtualView to the platform editor. These mappers ensure that when CursorPosition or SelectionLength changes on the SearchBar, the corresponding values are updated on the underlying UITextField. - Introduced SearchEditorDelegate (UITextFieldDelegate) with DidChangeSelection override to detect cursor repositioning and selection changes. - In WillMoveToWindow, assign the delegate when attached to the window and clear it when removed. - Handler proxy subscribes to platformView.SelectionChanged → OnSelectionChanged, following the pattern used in EntryHandler.iOS. - Added MapCursorPosition and MapSelectionLength to update the native editor using SetTextRange(). - **Windows:** - In the OnGotFocus handler (after PlatformView is loaded), locate the inner TextBox using GetFirstDescendant<TextBox>(). - Subscribe to TextBox.SelectionChanged. - OnPlatformSelectionChanged reads _queryTextBox.GetCursorPosition() and _queryTextBox.SelectionLength and syncs them to VirtualView. - DisconnectHandler now unsubscribes from the event and clears _queryTextBox. - Added MapCursorPosition and MapSelectionLength that delegate to _queryTextBox.UpdateCursorPosition and _queryTextBox.UpdateSelectionLength. - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #30779 | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/8a62a1b1-cfab-4e89-a4a6-07094b62ba19"> | <video src="https://github.com/user-attachments/assets/275fa165-59ed-4e98-b45c-2b445789ee2e"> | --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…typing (#34347) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> SearchBar.CursorPosition and SelectionLength properties don't work correctly. **Android:** QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates. **iOS / MacCatalyst:** The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state. **Windows:** AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView. **Android:** - Added QueryEditorTouchListener to read the cursor position on ACTION_UP. - Added QueryEditorKeyListener to read the cursor position on key ACTION_UP. - OnQueryTextChange now invokes OnQueryEditorSelectionChanged(), which posts a deferred read of GetCursorPosition() and GetSelectedTextLength() - Implemented MapCursorPosition and MapSelectionLength mappers that delegate to QueryEditor.UpdateCursorPosition and QueryEditor.UpdateSelectionLength. - Updated EditTextExtensions.UpdateCursorSelection to wrap SetSelection in a Post() when the control is focused, preventing race conditions with SearchView.setQuery(). - Updated GetSelectedTextLength() to use Math.Abs() to correctly handle RTL selections. - **iOS / MacCatalyst:** - Added property mappers to synchronize cursor and selection values from the VirtualView to the platform editor. These mappers ensure that when CursorPosition or SelectionLength changes on the SearchBar, the corresponding values are updated on the underlying UITextField. - Introduced SearchEditorDelegate (UITextFieldDelegate) with DidChangeSelection override to detect cursor repositioning and selection changes. - In WillMoveToWindow, assign the delegate when attached to the window and clear it when removed. - Handler proxy subscribes to platformView.SelectionChanged → OnSelectionChanged, following the pattern used in EntryHandler.iOS. - Added MapCursorPosition and MapSelectionLength to update the native editor using SetTextRange(). - **Windows:** - In the OnGotFocus handler (after PlatformView is loaded), locate the inner TextBox using GetFirstDescendant<TextBox>(). - Subscribe to TextBox.SelectionChanged. - OnPlatformSelectionChanged reads _queryTextBox.GetCursorPosition() and _queryTextBox.SelectionLength and syncs them to VirtualView. - DisconnectHandler now unsubscribes from the event and clears _queryTextBox. - Added MapCursorPosition and MapSelectionLength that delegate to _queryTextBox.UpdateCursorPosition and _queryTextBox.UpdateSelectionLength. - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #30779 | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/8a62a1b1-cfab-4e89-a4a6-07094b62ba19"> | <video src="https://github.com/user-attachments/assets/275fa165-59ed-4e98-b45c-2b445789ee2e"> | --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…typing (#34347) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> SearchBar.CursorPosition and SelectionLength properties don't work correctly. **Android:** QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates. **iOS / MacCatalyst:** The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state. **Windows:** AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView. **Android:** - Added QueryEditorTouchListener to read the cursor position on ACTION_UP. - Added QueryEditorKeyListener to read the cursor position on key ACTION_UP. - OnQueryTextChange now invokes OnQueryEditorSelectionChanged(), which posts a deferred read of GetCursorPosition() and GetSelectedTextLength() - Implemented MapCursorPosition and MapSelectionLength mappers that delegate to QueryEditor.UpdateCursorPosition and QueryEditor.UpdateSelectionLength. - Updated EditTextExtensions.UpdateCursorSelection to wrap SetSelection in a Post() when the control is focused, preventing race conditions with SearchView.setQuery(). - Updated GetSelectedTextLength() to use Math.Abs() to correctly handle RTL selections. - **iOS / MacCatalyst:** - Added property mappers to synchronize cursor and selection values from the VirtualView to the platform editor. These mappers ensure that when CursorPosition or SelectionLength changes on the SearchBar, the corresponding values are updated on the underlying UITextField. - Introduced SearchEditorDelegate (UITextFieldDelegate) with DidChangeSelection override to detect cursor repositioning and selection changes. - In WillMoveToWindow, assign the delegate when attached to the window and clear it when removed. - Handler proxy subscribes to platformView.SelectionChanged → OnSelectionChanged, following the pattern used in EntryHandler.iOS. - Added MapCursorPosition and MapSelectionLength to update the native editor using SetTextRange(). - **Windows:** - In the OnGotFocus handler (after PlatformView is loaded), locate the inner TextBox using GetFirstDescendant<TextBox>(). - Subscribe to TextBox.SelectionChanged. - OnPlatformSelectionChanged reads _queryTextBox.GetCursorPosition() and _queryTextBox.SelectionLength and syncs them to VirtualView. - DisconnectHandler now unsubscribes from the event and clears _queryTextBox. - Added MapCursorPosition and MapSelectionLength that delegate to _queryTextBox.UpdateCursorPosition and _queryTextBox.UpdateSelectionLength. - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #30779 | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/8a62a1b1-cfab-4e89-a4a6-07094b62ba19"> | <video src="https://github.com/user-attachments/assets/275fa165-59ed-4e98-b45c-2b445789ee2e"> | --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Blazor - Fix: Filter precompressed RCL assets from MAUI Blazor Hybrid APKs by @mattleibow in #33917 <details> <summary>🔧 Fixes</summary> - [.NET MAUI Blazor Hybrid App should not precompress assets](#33773) </details> - [Windows] Fix for Runtime error when closing external window with WPF Webview Control by @BagavathiPerumal in #34006 <details> <summary>🔧 Fixes</summary> - [Runtime error when closing external window with WPF Webview Control](#32944) </details> ## Button - [Android] ImageButton CornerRadius not being applied - fix by @kubaflo in #30074 <details> <summary>🔧 Fixes</summary> - [ImageButton CornerRadius not being applied on Android](#23854) </details> - Fix Disabled visual state ignored when Button has locally-set BackgroundColor/TextColor by @Dhivya-SF4094 in #34444 <details> <summary>🔧 Fixes</summary> - [[regression/9.0] VisualState "Disabled" is not properly applied for Button with custom appearance](#34363) </details> ## CollectionView - Fix CollectionView grid spacing updates for first row and column by @KarthikRajaKalaimani in #34527 <details> <summary>🔧 Fixes</summary> - [[MAUI] I2_Vertical grid for horizontal Item Spacing and Vertical Item Spacing - horizontally updating the spacing only applies to the second column](#34257) </details> - Fix CollectionView record struct selection on Windows by @jeremy-visionaid in #33488 - [Android] Ensure disconnected ItemsViewHandler doesn't hold onto the items source by @filipnavara in #24610 <details> <summary>🔧 Fixes</summary> - [Crash on NullReferenceException with measurement cells in CollectionView](#24304) </details> - [Windows] Fixed VisualState Setters not working properly for CollectionView by @Dhivya-SF4094 in #27230 <details> <summary>🔧 Fixes</summary> - [VisualState Setters not working properly on Windows for a CollectionView](#27086) - [[regression/8.0.3] [Windows][CollectionView]Label Disappear when set Style in ContentPage.Resources](#19209) - [[Windows] Label style defined as ContentPage Resource doesn't propagate to CollectionView](#18701) </details> - [Windows] Fixed Margin doesn't work inside CollectionView EmptyView by @Dhivya-SF4094 in #29897 <details> <summary>🔧 Fixes</summary> - [Margin doesn't work inside CollectionView EmptyView](#8494) </details> - [Android, Windows] Fix CarouselView PreviousPosition/PreviousItem incorrect during animated ScrollTo() by @praveenkumarkarunanithi in #34570 <details> <summary>🔧 Fixes</summary> - [[Android] CurrentItemChangedEventArgs.PreviousItem and PositionChangedEventArgs.PreviousPosition Not Updating Correctly When Using ScrollTo or Setting Position](#29544) </details> - [iOS] CarouselView2: Update internal scroll indicators for compositional layout by @SubhikshaSf4851 in #33639 <details> <summary>🔧 Fixes</summary> - [[iOS] Horizontal Scroll Bar Not Visible on CarouselView (CV2)](#29390) </details> - [CarouselViewHandler2] Fir fox CurrentItem does not work when ItemSpacing is set by @SyedAbdulAzeemSF4852 in #32135 <details> <summary>🔧 Fixes</summary> - [[CarouselViewHandler2] CurrentItem does not work when ItemSpacing is set](#32048) </details> - [iOS] Fix for Incorrect Scroll in Loop Mode When CurrentItem Is Not Found in ItemsSource by @SyedAbdulAzeemSF4852 in #32141 <details> <summary>🔧 Fixes</summary> - [[Android & iOS] Setting an invalid CurrentItem causes scroll to last item in looped CarouselView](#32139) </details> - [Android] IndicatorView: Add TalkBack accessibility descriptions for indicators by @praveenkumarkarunanithi in #31775 <details> <summary>🔧 Fixes</summary> - [[Android] IndicatorView does not convey correct accessibility information](#31446) </details> - [iOS, macOS] Fixed CollectionView KeepLastItemInView Not Updating Correctly When Items Are Added Dynamically by @NanthiniMahalingam in #32191 <details> <summary>🔧 Fixes</summary> - [[.NET10] I9 - Scroll_Position - "KeepLastItemInView" does not keep the last item at the end of the displayed list when adding new items.](#31825) </details> - [Windows, Android] Resolved issue with dynamic Header/Footer reassignment in CollectionView. by @prakashKannanSf3972 in #28403 <details> <summary>🔧 Fixes</summary> - [[Windows, Android] Toggling Header/Footer in CollectionView Dynamically is not working](#27959) - [CollectionView HeaderTemplate and FooterTemplate are not displayed when ItemsSource is initially set to null](#28337) - [[Android] Header and Footer Not Visible in CollectionView When EmptyView is Selected First](#28351) </details> - [Android] Fix CollectionView inside disabled RefreshView blocks scroll by @Vignesh-SF3580 in #34702 <details> <summary>🔧 Fixes</summary> - [C6-The C6 page cannot scroll on Windows and Android platforms.](#34666) </details> - [Android] CollectionView: Fix SelectedItem visual state not applying when re-selecting same item by @KarthikRajaKalaimani in #31591 <details> <summary>🔧 Fixes</summary> - [CollectionView - SelectedItem visual state manager not working](#20062) </details> - [Windows] Fixed CollectionView.EmptyView can not be removed by setting it to Null by @Dhivya-SF4094 in #29487 <details> <summary>🔧 Fixes</summary> - [[Windows] CollectionView.EmptyView can not be removed by setting it to Null](#18657) - [[Windows] EmptyViewTemplate Not Working in CarouselView](#29463) - [EmptyViewTemplate does not do anything](#18551) - [[MAUI] I5_EmptyView - The data template selector cannot display the correct string.](#23330) </details> - [iOS] Support for IsSwipeEnabled on CarouselView2 by @kubaflo in #29996 <details> <summary>🔧 Fixes</summary> - [[iOS] IsSwipeEnabled Not Working on CarouselView (CV2)](#29391) </details> - [iOS, MacOS] Fixed FlowDirection not working on Header/Footer in CollectionView by @Dhivya-SF4094 in #32775 <details> <summary>🔧 Fixes</summary> - [[iOS, MacOS] FlowDirection not working on Header/Footer in CollectionView](#32771) </details> - [iOS] CollectionView: Fix drag-and-drop reordering into empty groups by @SuthiYuvaraj in #34151 <details> <summary>🔧 Fixes</summary> - [CollectionView Drag and Drop Reordering Can't Drop in Empty Group](#12008) </details> - [Android] CollectionView: Fix drag-and-drop reordering into empty groups by @SuthiYuvaraj in #31867 <details> <summary>🔧 Fixes</summary> - [CollectionView Drag and Drop Reordering Can't Drop in Empty Group](#12008) </details> - [iOS] Fix vertical CarouselView MandatorySingle snapping on iOS by @Vignesh-SF3580 in #34700 <details> <summary>🔧 Fixes</summary> - [CarouselView vertical snap points ignored on iOS with Microsoft.Maui.Controls v10.0.20 (regression from v9.0.120)](#33308) </details> - [iOS26] Fix CarouselView scrolling to wrong item when navigating to last item by @Vignesh-SF3580 in #34013 <details> <summary>🔧 Fixes</summary> - [[iOS 26] CarouselView does not scroll to the correct last item](#33770) </details> - Fixed the OnPlatform does not work for header property in Collection view by @NanthiniMahalingam in #28935 <details> <summary>🔧 Fixes</summary> - [OnPlatform does not work in Header of CollectionView](#25124) </details> - [Android] [Candidate branch] Fix VerifySelectedItemClearsOnNullAssignment, CollectionViewSelectionShouldClear, SelectedItemVisualIsCleared UI test failure on Android by @KarthikRajaKalaimani in #34928 ## DateTimePicker - [iOS] Fix for DatePicker FlowDirection Not Working on iOS by @SyedAbdulAzeemSF4852 in #30193 <details> <summary>🔧 Fixes</summary> - [[iOS] DatePicker FlowDirection Not Working on iOS](#30065) </details> ## Drawing - [Shapes] Line: Fix asymmetric Stretch.None path translation when right/bottom edge overflows by @NirmalKumarYuvaraj in #34385 <details> <summary>🔧 Fixes</summary> - [Line coordinates not computed correctly](#11404) - [Lines not drawing correctly](#26961) </details> - [Android] Fixed GraphicsView drawable is visible outside the canvas by @NirmalKumarYuvaraj in #28353 <details> <summary>🔧 Fixes</summary> - [[Android] GraphicsView, The drawn image can also be visible outside the canvas](#20834) </details> - Fixed Custom Drawable does not support binding by @NirmalKumarYuvaraj in #29442 <details> <summary>🔧 Fixes</summary> - [Custom IDrawable control does not databind to a model property when used inside a CollectionView ItemTemplate](#20991) </details> - Added a support for GradientBrushes on Shape.Stroke by @kubaflo in #22208 <details> <summary>🔧 Fixes</summary> - [GradientBrushes are not supported on Shape.Stroke](#21983) </details> ## Editor - Fixed Editor HorizontalTextAlignment does not update at run time by @NirmalKumarYuvaraj in #25129 <details> <summary>🔧 Fixes</summary> - [Editor HorizontalTextAlignment Does not Works.](#10987) - [[iOS/MacOs] Right-To-Left (RTL) alignment is not applied to Editor placeholder](#30052) </details> - [Windows] Fixed Entry Editor placeholder Text CharacterSpacing by @SubhikshaSf4851 in #30324 <details> <summary>🔧 Fixes</summary> - [[Windows] CharacterSpacing not applied to Placeholder text in Entry and Editor controls](#30071) </details> ## Entry - [Windows] Fix fo setting an Entry's Keyboard to Date causes it to be interpreted as a password input by @SyedAbdulAzeemSF4852 in #29344 <details> <summary>🔧 Fixes</summary> - [[Windows] Entry Keyboad-Type "Date" results in Password-Entry](#28975) </details> - [Android] Exception thrown when give more than 5000 characters to the Text property of Entry. by @KarthikRajaKalaimani in #30242 <details> <summary>🔧 Fixes</summary> - [Android crash when Entry has >5000 characters](#30144) </details> ## Essentials - Bump MonoApiToolsMSBuildTasksPackageVersion to 0.5.0 and ship Essentials.AI public APIs by @mattleibow via @Copilot in #34574 - [Mac] DeviceDisplay.KeepScreenOn not being respected on Mac OS by @HarishwaranVijayakumar in #32708 <details> <summary>🔧 Fixes</summary> - [[Mac Catalyst] DeviceDisplay.KeepScreenOn not being respected on Mac OS](#26059) </details> ## Flyoutpage - [Windows] FlyoutPage: update CollapseStyle at runtime by @devanathan-vaithiyanathan in #29927 <details> <summary>🔧 Fixes</summary> - [Flyout Page SetCollapseStyle doesn't have any change](#18200) </details> ## Gestures - [Android] Fix for TapGestureRecognizer doesn't fire by @HarishwaranVijayakumar in #34497 <details> <summary>🔧 Fixes</summary> - [[Android] TapGestureRecognizer doesn't fire](#5825) </details> ## Image - [Android] Fix Share.RequestAsync SecurityException on Android 10+ caused by missing ClipData by @HarishwaranVijayakumar in #34417 <details> <summary>🔧 Fixes</summary> - [[Bug] Share.RequestAsync throws java.lang.SecurityException (uid=1000) on Android 10+ due to missing intent.ClipData](#34370) </details> - [Windows]Fixed the MauiImage with logical name containing path issue by @sheiksyedm in #32864 <details> <summary>🔧 Fixes</summary> - [MauiImage with LogicalName containing path - is not working on Windows](#32356) </details> - [Android, Windows & iOS] Fix Downsize/ScaleImage to maintain aspect ratio and prevent upscaling by @SyedAbdulAzeemSF4852 in #30808 <details> <summary>🔧 Fixes</summary> - [[Android & Windows] In GraphicsView, the aspect ratio is not maintained when Downsize is called with both maxWidth and maxHeight](#30803) </details> ## Label - [iOS , macOS] Fixed Label text cropping when a width request is specified on the label inside a VerticalStackLayout with specified width request by @NanthiniMahalingam in #29166 <details> <summary>🔧 Fixes</summary> - [Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout](#28660) - [[iOS] Label with a fixed WidthRequest has wrong height](#26644) </details> - [Android] Fix Label word wrapping clips text depending on alignment and layout options by @Dhivya-SF4094 in #34533 <details> <summary>🔧 Fixes</summary> - [Bug: Android Label word wrapping clips text depending on alignment and layout options](#34459) </details> - LineHeight and decorations for HTML Label - fix by @kubaflo in #31202 <details> <summary>🔧 Fixes</summary> - [LineHeight with HTML Label not working](#22193) - [lineheight is broken ](#22197) </details> - [iOS] Fix Label with TailTruncation not rendering after empty-to-non-empty text transition by @kubaflo in #34812 <details> <summary>🔧 Fixes</summary> - [Label with LineBreakMode="TailTruncation" does not render text if initial Text is null or empty on first render (iOS)](#34591) </details> ## Layout - [Android] Fix overflowing children clipped when parent Opacity < 1 by @SyedAbdulAzeemSF4852 in #34565 <details> <summary>🔧 Fixes</summary> - [Maui Android parent view inappropriately creates clipping mask when its opacity is less than 1, cropping out children](#22038) </details> - Fixed the FlexLayout reverse issue with the AlignContent by @Ahamed-Ali in #32134 <details> <summary>🔧 Fixes</summary> - [FlexLayout alignment issue when Wrap is set to Reverse and AlignContent is set to SpaceAround, SpaceBetween or SpaceEvenly](#31565) </details> - [iOS/Mac] Fixed BoxView in AbsoluteLayout did not return to its default AutoSize for Height and Width after reset by @Dhivya-SF4094 in #31648 <details> <summary>🔧 Fixes</summary> - [[iOS, Catalyst] BoxView in AbsoluteLayout does not return to default AutoSize for Height/Width after reset](#31496) </details> ## Map - [Windows] Implement WinUI 3 MapControl handler using Azure Maps by @jfversluis in #34138 ## Modal - [Android] PopToRootAsync for modal pages - improvements by @kubaflo in #26851 <details> <summary>🔧 Fixes</summary> - [Shell PopToRootAsync doesn't happen instantly - previous pages flash quickly. Only happens in NET 9](#26846) </details> - [Android] Fix HideSoftInputOnTapped doesn't work on Modal Pages by @HarishwaranVijayakumar in #34770 <details> <summary>🔧 Fixes</summary> - [HideSoftInputOnTapped doesn't work on Modal Pages](#34730) </details> ## Navigation - [iOS] Alert popup may be displayed on wrong window when modal page navigation is in progress - fix by @kubaflo in #31016 <details> <summary>🔧 Fixes</summary> - [Alert popup may be displayed on wrong window when modal page navigation is in progress on iOS/MacOS](#30970) </details> - [Android] Page: Fix OnNavigatedTo called twice when NavigationPage is FlyoutPage Detail by @KarthikRajaKalaimani in #31931 <details> <summary>🔧 Fixes</summary> - [NavigationPage and FlyoutPage both call OnNavigatedTo, so it is called twice](#23902) </details> ## Picker - Fixed the Picker didn't dismiss it when tapping outside on iOS and MacCatalyst platform. by @KarthikRajaKalaimani in #30067 <details> <summary>🔧 Fixes</summary> - [[regression/8.0.3] iOS Picker dismiss does not work when clicking outside of the Picker](#19168) </details> - [Windows] Fixed Picker items width wont resize back by @SubhikshaSf4851 in #33042 <details> <summary>🔧 Fixes</summary> - [Picker items width won't resize back when its container window gets resized down.](#32984) </details> ## RadioButton - Fix TalkBack not correctly narrating RadioButtons with Content by @SubhikshaSf4851 in #34521 <details> <summary>🔧 Fixes</summary> - [[Android] TalkBack does not correctly narrate RadioButtons with Content](#34322) </details> ## SafeArea - [Android] Fix SafeAreaShouldWorkOnAllShellTabs test failure on API 36 by @praveenkumarkarunanithi in #34239 ## ScrollView - [iOS] Preserve ScrollView offsets when Orientation changes to Neither by @Vignesh-SF3580 in #34672 <details> <summary>🔧 Fixes</summary> - [Incorrect implementation of ScrollView.Orientation](#34583) </details> ## Searchbar - [Android] Fix SearchBar text bleeding between instances after navigation by @SyedAbdulAzeemSF4852 in #34703 <details> <summary>🔧 Fixes</summary> - [MAUI Android: SearchBar copies content from one to the other](#20348) </details> - Fixed SearchBar CursorPosition and SelectionLength not updating when typing by @Dhivya-SF4094 in #34347 <details> <summary>🔧 Fixes</summary> - [SearchBar - CursorPosition and SelectionLength are not updated when the user types](#30779) </details> ## SearchBar - [Windows] Fixed SearchHandler issues by @Tamilarasan-Paranthaman in #29520 <details> <summary>🔧 Fixes</summary> - [[Windows] SearchHandler APIs are not functioning properly](#29493) </details> ## Shell - [iOS, Mac] Fix for Background set to Transparent doesn't have the same behavior as BackgroundColor Transparent by @HarishwaranVijayakumar in #32245 <details> <summary>🔧 Fixes</summary> - [Background set to Transparent doesn't have the same behavior as BackgroundColor = Transparent](#22769) </details> - [iOS] Fix App crash with NullReferenceException in ShellSectionRenderer by @devanathan-vaithiyanathan in #32109 <details> <summary>🔧 Fixes</summary> - [[iOS] App crash with NullReferenceException in ShellSectionRenderer](#31961) </details> - [Android] Fixed back button icon selection logic in ShellToolbarTracker by @kubaflo in #32080 <details> <summary>🔧 Fixes</summary> - [IconOverride in Shell.BackButtonBehavior does not work.](#32050) </details> - Fix TabBarIsVisible Not Updating Dynamically When Set on ShellContent by @Vignesh-SF3580 in #33090 <details> <summary>🔧 Fixes</summary> - [Shell.TabBarIsVisible is not updated dynamically at runtime](#32994) </details> - [iOS, macOS] Shell: Fix RTL flow direction for flyout, menu cells, tab bar, and Locked flyout position by @NanthiniMahalingam in #32701 <details> <summary>🔧 Fixes</summary> - [[iOS, Mac Catalyst] Shell Flyout and Content Do Not Fully Support RightToLeft (RTL)](#32419) </details> - [IOS] Inconsistent Resize Behavior for Header/Footer - fix by @kubaflo in #28713 <details> <summary>🔧 Fixes</summary> - [[IOS, Mac] Inconsistent Resize Behavior for Header/Footer](#26397) - [Enable Shell Flyout Header/Footer resize tests on iOS/Catalyst](#33501) </details> - [Android] Fix for SearchHandler retaining previous page SearchView data in pages within Shell sections by @BagavathiPerumal in #29545 <details> <summary>🔧 Fixes</summary> - [[Shell][Android] The truth is out there...but not on top tab search handlers](#8716) </details> - [Android] Fix empty space above TabBar after navigating back when TabBar visibility is toggled by @praveenkumarkarunanithi in #34324 <details> <summary>🔧 Fixes</summary> - [Empty space appears above TabBar after navigating back when TabBar visibility is toggled](#33703) - [Grid with SafeAreaEdges=Container has incorrect size when tab bar appears](#34256) </details> ## SwipeView - [Android] SwipeView: Use MeasureSpecMode.Exactly for SwipeItem layout to fix text visibility by @Ahamed-Ali in #27399 <details> <summary>🔧 Fixes</summary> - [[Android] Right SwipeView items are not visible in the SwipeView.](#27367) </details> - [Android] Prevent the tap that closes an open SwipeView from being propagated to children by @sjordanGSS in #24275 <details> <summary>🔧 Fixes</summary> - [Tapping to close a SwipeView will activate TapGestureRecognizers on .Content](#23921) </details> ## Switch - [iOS & Mac] Fix for SearchHandler retains previous page state when switching top tabs by @BagavathiPerumal in #34735 <details> <summary>🔧 Fixes</summary> - [[Shell] [iOS & Mac] SearchHandler retains previous page state when switching top tabs](#34693) </details> ## TabbedPage - [Android] Fixed NullReferenceException in app with TabBar after returning from minimized state by @NirmalKumarYuvaraj in #34779 <details> <summary>🔧 Fixes</summary> - [NullReferenceException in app with TabBar after returning from minimized state](#34720) </details> ## Titlebar - Fixed BindingContext of the Window TitleBar is not being passed on to its child content. by @NirmalKumarYuvaraj in #30080 <details> <summary>🔧 Fixes</summary> - [The BindingContext of the Window TitleBar is not being passed on to its child content.](#24831) </details> - [Windows/Mac] Fix RTL FlowDirection causes overlap with native window control buttons in TitleBar by @devanathan-vaithiyanathan in #30400 <details> <summary>🔧 Fixes</summary> - [[Windows, Mac] RTL FlowDirection causes overlap with native window control buttons in TitleBar](#30399) </details> ## WebView - [Windows] Fix WebView background color not being applied by @SubhikshaSf4851 in #34599 <details> <summary>🔧 Fixes</summary> - [WebView background color has changed after update, can't override.](#34518) </details> - [Android] Fix for WebView/HybridWebView briefly flashes full screen before layout completes by @praveenkumarkarunanithi in #33207 <details> <summary>🔧 Fixes</summary> - [[Android] HybridWebView briefly resizes to full screen when page is opened before snapping back to correct size](#31475) </details> ## Xaml - Improved style inheritance by @kubaflo in #31317 <details> <summary>🔧 Fixes</summary> - [Styles based on a style that is based on another style that uses AppThemeBinding do not inherit properties correctly.](#31280) </details> - Fix for VisualStateManager Setter.TargetName failing when ControlTemplate is applied by @BagavathiPerumal in #33208 <details> <summary>🔧 Fixes</summary> - [Setter.TargetName + ControlTemplate crash](#26977) </details> <details> <summary>🧪 Testing (4)</summary> - [Testing] Additional Feature Matrix Event Test Cases for Slider and ScrollView by @nivetha-nagalingam in #34352 - [Testing] Fixed Build error on inflight/ candidate PR 34885 by @NafeelaNazhir in #34891 - [Testing] Fixed UI test image failure in PR 34885 - [13/4/2026] by @NafeelaNazhir in #34933 - Fixed test failure - CursorPositionUpdatesWhenSearchBarGainsFocus by @Dhivya-SF4094 in #34938 </details> <details> <summary>📦 Other (3)</summary> - Fix Loaded event not called for MAUI View added to native View by @NirmalKumarYuvaraj in #34345 <details> <summary>🔧 Fixes</summary> - [Loaded event not called for MAUI View added to native View](#34310) </details> - Add public IAlertManager and IAlertManagerSubscription interfaces by @Redth in #34228 <details> <summary>🔧 Fixes</summary> - [Alert/Dialog system (`DisplayAlert`, `DisplayActionSheet`, `DisplayPromptAsync`) needs a public extensibility point](#34104) </details> - Fix crash when displaying alerts on unloaded pages by @kubaflo in #33288 </details> <details> <summary>📝 Issue References</summary> Fixes #5825, Fixes #8494, Fixes #8716, Fixes #10987, Fixes #11404, Fixes #12008, Fixes #18200, Fixes #18551, Fixes #18657, Fixes #18701, Fixes #19168, Fixes #19209, Fixes #20062, Fixes #20348, Fixes #20834, Fixes #20991, Fixes #21983, Fixes #22038, Fixes #22193, Fixes #22197, Fixes #22769, Fixes #23330, Fixes #23854, Fixes #23902, Fixes #23921, Fixes #24304, Fixes #24831, Fixes #25124, Fixes #26059, Fixes #26397, Fixes #26644, Fixes #26846, Fixes #26961, Fixes #26977, Fixes #27086, Fixes #27367, Fixes #27959, Fixes #28337, Fixes #28351, Fixes #28660, Fixes #28975, Fixes #29390, Fixes #29391, Fixes #29463, Fixes #29493, Fixes #29544, Fixes #30052, Fixes #30065, Fixes #30071, Fixes #30144, Fixes #30399, Fixes #30779, Fixes #30803, Fixes #30970, Fixes #31280, Fixes #31446, Fixes #31475, Fixes #31496, Fixes #31565, Fixes #31825, Fixes #31961, Fixes #32048, Fixes #32050, Fixes #32139, Fixes #32356, Fixes #32419, Fixes #32771, Fixes #32944, Fixes #32984, Fixes #32994, Fixes #33308, Fixes #33501, Fixes #33703, Fixes #33770, Fixes #33773, Fixes #34104, Fixes #34256, Fixes #34257, Fixes #34310, Fixes #34322, Fixes #34363, Fixes #34370, Fixes #34459, Fixes #34518, Fixes #34583, Fixes #34591, Fixes #34666, Fixes #34693, Fixes #34720, Fixes #34730 </details> **Full Changelog**: main...inflight/candidate
Issue Details
SearchBar.CursorPosition and SelectionLength properties don't work correctly.
Root Cause
Android:
QueryEditor is implemented using SearchView.SearchAutoComplete instead of MauiAppCompatEditText. Because of this, it does not expose a SelectionChanged event, and the handler was not tracking cursor or selection updates.
iOS / MacCatalyst:
The TextFieldEditingChanged handler updated VirtualView.Text, but it did not read back the CursorPosition or SelectionLength from the native UITextField, resulting in the virtual view not being synchronized with the platform cursor state.
Windows:
AutoSuggestBox internally wraps a TextBox. The handler did not subscribe to the inner TextBox.SelectionChanged event, so cursor and selection updates were not propagated to the VirtualView.
Description of Change
Android:
iOS / MacCatalyst:
Windows:
Validated the behaviour in the following platforms
Issues Fixed:
Fixes #30779
Screenshots
30779_Beforefix.mov
30779_Afterfix.mov