Repository navigation
[net11] Hide Issue28986 keyboards without Appium's BACK fallback - #40412
Merged
Merged
Conversation
App.DismissKeyboard() uses Appium's hideKeyboard on Android, which sends ESC and, if the IME is still reported as shown about a second later, sends BACK. When the IME hide outlasts that window the BACK key closes the test page's activity, so the next lookup throws a NullReferenceException or times out. Send only ESC while the keyboard is shown and wait for it to hide. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
temporarily deployed
to
copilot-pat-pool
November 19, 2026 03:24 — with
GitHub Actions
Inactive
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40412Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40412" |
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 19, 2026 03:24 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 19, 2026 03:26 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 19, 2026 03:28 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 19, 2026 03:29 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 19, 2026 03:30 — with
GitHub Actions
Inactive
1 task
This comment has been minimized.
This comment has been minimized.
Collaborator
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
Contributor
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 7dce404.
SubhikshaSf4851
pushed a commit
to SubhikshaSf4851/maui
that referenced
this pull request
Nov 23, 2026
…net#40412) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Test-only. On Android, `App.DismissKeyboard()` calls Appium's `hideKeyboard`. That sends ESC, and if the IME is still reported as shown about a second later, it also sends BACK. When the IME hide takes longer than that, BACK closes the test page's `MainActivity` and the launcher comes to the front. The next element lookup then throws a `NullReferenceException` or times out. This is the same mechanism as dotnet#40361 (Issue35119). There, BACK cancelled a prompt. The fix replaces the three Android `DismissKeyboard()` calls in `Issue28986_ContentPage` (`SafeAreaPerEdgeValidation`, `SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`) and `Issue28986.SafeAreaPerEdgeValidation` with a helper: - It waits for the keyboard to show. - It sends only ESC, which the visible IME consumes. - It asserts that the keyboard hides. iOS still calls `DismissKeyboard()`. No assertions, tolerances or baselines change. The keyboard tests in `Issue28986_SafeAreaBorderOrientation` are excluded on Android (`TEST_FAILS_ON_ANDROID`), so they are unchanged. **CI evidence.** Candidate UI 1689104, SafeAreaEdges API36 (log 2836): - The original attempt hit an NRE in `Tap("GridResetAllButton")` at line 156, right after `DismissKeyboard()` and a passing `WaitForKeyboardToHide()`. - Logcat shows ESC to Gboard, then the app's `onRequestHide`, then `onHidden` after a stalled IME dump. Then a `Transition CLOSE` for the app task brings the launcher to the front. - The same NRE@156 signature appears in UI builds 1687709 and 1687330. **Local causal validation.** Android 16 (API 36) emulator, `net11` Material3 HostApp APK from UI build 1688901, filter `Name=SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle|Name=SafeAreaPerEdgeValidation` (3 tests per run): | Phase | Runs | Failed tests | | --- | --- | --- | | Baseline (`net11`) | 3 | 9/9 | | Fixed | 3 | 1/9 | | Fix reverted | 3 | 6/9 | | Fix restored | 3 | 1/9 | - Baseline failures match CI: NRE at `Issue28986_ContentPage.cs:156` (4), timeout at line 105 (4), a failure at line 126 (1), and timeout in `Issue28986.cs` at line 193 (6). Each comes after ESC, then `onHidden`, then a mid-test `Transition CLOSE` of the uitests task. The app relaunches only after the timeout. - Both fixed-run failures are in `Issue28986_ContentPage.SafeAreaPerEdgeValidation` at line 121. That is the earlier "keyboard shown" assertion, before any hide. Logcat shows no `onRequestShow` in those runs, so the keyboard was never requested. This is a separate, pre-hide failure that this PR doesn't address. ### Issues Fixed Fixes CI flakiness in `Issue28986_ContentPage.SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`, `Issue28986_ContentPage.SafeAreaPerEdgeValidation` and `Issue28986.SafeAreaPerEdgeValidation` on Android. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
to kubaflo/maui
that referenced
this pull request
Nov 23, 2026
…net#40412) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Test-only. On Android, `App.DismissKeyboard()` calls Appium's `hideKeyboard`. That sends ESC, and if the IME is still reported as shown about a second later, it also sends BACK. When the IME hide takes longer than that, BACK closes the test page's `MainActivity` and the launcher comes to the front. The next element lookup then throws a `NullReferenceException` or times out. This is the same mechanism as dotnet#40361 (Issue35119). There, BACK cancelled a prompt. The fix replaces the three Android `DismissKeyboard()` calls in `Issue28986_ContentPage` (`SafeAreaPerEdgeValidation`, `SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`) and `Issue28986.SafeAreaPerEdgeValidation` with a helper: - It waits for the keyboard to show. - It sends only ESC, which the visible IME consumes. - It asserts that the keyboard hides. iOS still calls `DismissKeyboard()`. No assertions, tolerances or baselines change. The keyboard tests in `Issue28986_SafeAreaBorderOrientation` are excluded on Android (`TEST_FAILS_ON_ANDROID`), so they are unchanged. **CI evidence.** Candidate UI 1689104, SafeAreaEdges API36 (log 2836): - The original attempt hit an NRE in `Tap("GridResetAllButton")` at line 156, right after `DismissKeyboard()` and a passing `WaitForKeyboardToHide()`. - Logcat shows ESC to Gboard, then the app's `onRequestHide`, then `onHidden` after a stalled IME dump. Then a `Transition CLOSE` for the app task brings the launcher to the front. - The same NRE@156 signature appears in UI builds 1687709 and 1687330. **Local causal validation.** Android 16 (API 36) emulator, `net11` Material3 HostApp APK from UI build 1688901, filter `Name=SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle|Name=SafeAreaPerEdgeValidation` (3 tests per run): | Phase | Runs | Failed tests | | --- | --- | --- | | Baseline (`net11`) | 3 | 9/9 | | Fixed | 3 | 1/9 | | Fix reverted | 3 | 6/9 | | Fix restored | 3 | 1/9 | - Baseline failures match CI: NRE at `Issue28986_ContentPage.cs:156` (4), timeout at line 105 (4), a failure at line 126 (1), and timeout in `Issue28986.cs` at line 193 (6). Each comes after ESC, then `onHidden`, then a mid-test `Transition CLOSE` of the uitests task. The app relaunches only after the timeout. - Both fixed-run failures are in `Issue28986_ContentPage.SafeAreaPerEdgeValidation` at line 121. That is the earlier "keyboard shown" assertion, before any hide. Logcat shows no `onRequestShow` in those runs, so the keyboard was never requested. This is a separate, pre-hide failure that this PR doesn't address. ### Issues Fixed Fixes CI flakiness in `Issue28986_ContentPage.SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`, `Issue28986_ContentPage.SafeAreaPerEdgeValidation` and `Issue28986.SafeAreaPerEdgeValidation` on Android. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
SuthiYuvaraj
pushed a commit
to SuthiYuvaraj/maui
that referenced
this pull request
Nov 25, 2026
…net#40412) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Test-only. On Android, `App.DismissKeyboard()` calls Appium's `hideKeyboard`. That sends ESC, and if the IME is still reported as shown about a second later, it also sends BACK. When the IME hide takes longer than that, BACK closes the test page's `MainActivity` and the launcher comes to the front. The next element lookup then throws a `NullReferenceException` or times out. This is the same mechanism as dotnet#40361 (Issue35119). There, BACK cancelled a prompt. The fix replaces the three Android `DismissKeyboard()` calls in `Issue28986_ContentPage` (`SafeAreaPerEdgeValidation`, `SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`) and `Issue28986.SafeAreaPerEdgeValidation` with a helper: - It waits for the keyboard to show. - It sends only ESC, which the visible IME consumes. - It asserts that the keyboard hides. iOS still calls `DismissKeyboard()`. No assertions, tolerances or baselines change. The keyboard tests in `Issue28986_SafeAreaBorderOrientation` are excluded on Android (`TEST_FAILS_ON_ANDROID`), so they are unchanged. **CI evidence.** Candidate UI 1689104, SafeAreaEdges API36 (log 2836): - The original attempt hit an NRE in `Tap("GridResetAllButton")` at line 156, right after `DismissKeyboard()` and a passing `WaitForKeyboardToHide()`. - Logcat shows ESC to Gboard, then the app's `onRequestHide`, then `onHidden` after a stalled IME dump. Then a `Transition CLOSE` for the app task brings the launcher to the front. - The same NRE@156 signature appears in UI builds 1687709 and 1687330. **Local causal validation.** Android 16 (API 36) emulator, `net11` Material3 HostApp APK from UI build 1688901, filter `Name=SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle|Name=SafeAreaPerEdgeValidation` (3 tests per run): | Phase | Runs | Failed tests | | --- | --- | --- | | Baseline (`net11`) | 3 | 9/9 | | Fixed | 3 | 1/9 | | Fix reverted | 3 | 6/9 | | Fix restored | 3 | 1/9 | - Baseline failures match CI: NRE at `Issue28986_ContentPage.cs:156` (4), timeout at line 105 (4), a failure at line 126 (1), and timeout in `Issue28986.cs` at line 193 (6). Each comes after ESC, then `onHidden`, then a mid-test `Transition CLOSE` of the uitests task. The app relaunches only after the timeout. - Both fixed-run failures are in `Issue28986_ContentPage.SafeAreaPerEdgeValidation` at line 121. That is the earlier "keyboard shown" assertion, before any hide. Logcat shows no `onRequestShow` in those runs, so the keyboard was never requested. This is a separate, pre-hide failure that this PR doesn't address. ### Issues Fixed Fixes CI flakiness in `Issue28986_ContentPage.SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`, `Issue28986_ContentPage.SafeAreaPerEdgeValidation` and `Issue28986.SafeAreaPerEdgeValidation` on Android. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani
pushed a commit
to KarthikRajaKalaimani/maui
that referenced
this pull request
Nov 26, 2026
…net#40412) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Test-only. On Android, `App.DismissKeyboard()` calls Appium's `hideKeyboard`. That sends ESC, and if the IME is still reported as shown about a second later, it also sends BACK. When the IME hide takes longer than that, BACK closes the test page's `MainActivity` and the launcher comes to the front. The next element lookup then throws a `NullReferenceException` or times out. This is the same mechanism as dotnet#40361 (Issue35119). There, BACK cancelled a prompt. The fix replaces the three Android `DismissKeyboard()` calls in `Issue28986_ContentPage` (`SafeAreaPerEdgeValidation`, `SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`) and `Issue28986.SafeAreaPerEdgeValidation` with a helper: - It waits for the keyboard to show. - It sends only ESC, which the visible IME consumes. - It asserts that the keyboard hides. iOS still calls `DismissKeyboard()`. No assertions, tolerances or baselines change. The keyboard tests in `Issue28986_SafeAreaBorderOrientation` are excluded on Android (`TEST_FAILS_ON_ANDROID`), so they are unchanged. **CI evidence.** Candidate UI 1689104, SafeAreaEdges API36 (log 2836): - The original attempt hit an NRE in `Tap("GridResetAllButton")` at line 156, right after `DismissKeyboard()` and a passing `WaitForKeyboardToHide()`. - Logcat shows ESC to Gboard, then the app's `onRequestHide`, then `onHidden` after a stalled IME dump. Then a `Transition CLOSE` for the app task brings the launcher to the front. - The same NRE@156 signature appears in UI builds 1687709 and 1687330. **Local causal validation.** Android 16 (API 36) emulator, `net11` Material3 HostApp APK from UI build 1688901, filter `Name=SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle|Name=SafeAreaPerEdgeValidation` (3 tests per run): | Phase | Runs | Failed tests | | --- | --- | --- | | Baseline (`net11`) | 3 | 9/9 | | Fixed | 3 | 1/9 | | Fix reverted | 3 | 6/9 | | Fix restored | 3 | 1/9 | - Baseline failures match CI: NRE at `Issue28986_ContentPage.cs:156` (4), timeout at line 105 (4), a failure at line 126 (1), and timeout in `Issue28986.cs` at line 193 (6). Each comes after ESC, then `onHidden`, then a mid-test `Transition CLOSE` of the uitests task. The app relaunches only after the timeout. - Both fixed-run failures are in `Issue28986_ContentPage.SafeAreaPerEdgeValidation` at line 121. That is the earlier "keyboard shown" assertion, before any hide. Logcat shows no `onRequestShow` in those runs, so the keyboard was never requested. This is a separate, pre-hide failure that this PR doesn't address. ### Issues Fixed Fixes CI flakiness in `Issue28986_ContentPage.SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle`, `Issue28986_ContentPage.SafeAreaPerEdgeValidation` and `Issue28986.SafeAreaPerEdgeValidation` on Android. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.Description of Change
Test-only. On Android,
App.DismissKeyboard()calls Appium'shideKeyboard. That sends ESC, and if the IME is still reported as shown about a second later, it also sends BACK. When the IME hide takes longer than that, BACK closes the test page'sMainActivityand the launcher comes to the front. The next element lookup then throws aNullReferenceExceptionor times out.This is the same mechanism as #40361 (Issue35119). There, BACK cancelled a prompt.
The fix replaces the three Android
DismissKeyboard()calls inIssue28986_ContentPage(SafeAreaPerEdgeValidation,SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle) andIssue28986.SafeAreaPerEdgeValidationwith a helper:iOS still calls
DismissKeyboard(). No assertions, tolerances or baselines change. The keyboard tests inIssue28986_SafeAreaBorderOrientationare excluded on Android (TEST_FAILS_ON_ANDROID), so they are unchanged.CI evidence. Candidate UI 1689104, SafeAreaEdges API36 (log 2836):
Tap("GridResetAllButton")at line 156, right afterDismissKeyboard()and a passingWaitForKeyboardToHide().onRequestHide, thenonHiddenafter a stalled IME dump. Then aTransition CLOSEfor the app task brings the launcher to the front.Local causal validation. Android 16 (API 36) emulator,
net11Material3 HostApp APK from UI build 1688901, filterName=SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle|Name=SafeAreaPerEdgeValidation(3 tests per run):net11)Issue28986_ContentPage.cs:156(4), timeout at line 105 (4), a failure at line 126 (1), and timeout inIssue28986.csat line 193 (6). Each comes after ESC, thenonHidden, then a mid-testTransition CLOSEof the uitests task. The app relaunches only after the timeout.Issue28986_ContentPage.SafeAreaPerEdgeValidationat line 121. That is the earlier "keyboard shown" assertion, before any hide. Logcat shows noonRequestShowin those runs, so the keyboard was never requested. This is a separate, pre-hide failure that this PR doesn't address.Issues Fixed
Fixes CI flakiness in
Issue28986_ContentPage.SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle,Issue28986_ContentPage.SafeAreaPerEdgeValidationandIssue28986.SafeAreaPerEdgeValidationon Android.