Skip to content

[NET11][Android] [ShellHandler] Fix ScrollView crash when reparenting native content - #39759

Merged
kubaflo merged 1 commit into
dotnet:candidate/11.0.1xx-sr2from
Vignesh-SF3580:fix-39679net11
Nov 11, 2026
Merged

kubaflo merged 1 commit into
dotnet:candidate/11.0.1xx-sr2from
Vignesh-SF3580:fix-39679net11

Conversation

@Vignesh-SF3580

@Vignesh-SF3580 Vignesh-SF3580 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Note

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

Issue Detail

On Android, a ScrollView can crash when its handler attaches content to an internal container:
Java.Lang.IllegalStateException: The specified child already has a parent.

Root cause

The handler adds native content to an inset container without first detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content nested inside those containers. Android throws an exception when adding a view that already has a parent, as each native view can have only one parent.

Description of Change

Call nativeContent.RemoveFromParent() before adding the content in both scenarios:

  • Creating a new inset container.
  • Replacing content in an existing inset container.

This safely reparents the existing content without changing the measurement or scrolling logic.

Issues Fixed

Fixes #39758

Screenshot

Before Issue Fix After Issue Fix

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39759

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39759"

@Vignesh-SF3580 Vignesh-SF3580 added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Oct 29, 2026
@azure-pipelines

This comment has been minimized.

@vishnumenon2684

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 29, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expert Review — 0 findings

Reviewed commit 4a5277f.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot added s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) and removed s/agent-review-in-progress AI review is currently running for this PR labels Oct 29, 2026
@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@Vignesh-SF3580 Vignesh-SF3580 changed the title [WIP] [Android] [ShellHandler] Fix ScrollView crash when reparenting native content [Android] [ShellHandler] Fix ScrollView crash when reparenting native content Oct 30, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review October 30, 2026 06:22
Copilot AI balanced review requested due to automatic review settings October 30, 2026 06:22
@sheiksyedm sheiksyedm changed the title [Android] [ShellHandler] Fix ScrollView crash when reparenting native content [NET11][Android] [ShellHandler] Fix ScrollView crash when reparenting native content Oct 30, 2026
Copilot AI balanced review requested due to automatic review settings November 10, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the Android ScrollView reparenting fix.

No open issues 🎉

Review effort: Balanced

@vishnumenon2684

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 10, 2026
@kubaflo

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Tests Failure Analysis

@Vignesh-SF3580 — test-failure analysis for commit 31b067c.

Scope CI failures Commit 31b067c


🧪 CI Analysis — click to expand
📊 maui-pr

No failures found.


🧪 maui-pr-devicetests

No failures found.


🧪 maui-pr-uitests
  • 🟢 Likely unrelated — Android/Windows checkout, Gradle setup, and screen resolution: 11/8/4 failed steps respectively; sampled logs show GitHub authentication failures and missing checkout files before tests, outside the unchanged CI setup.
  • 🟢 Likely unrelated — MacCatalyst CoreCLR ButtonResizesWhenTitleOrImageChanges: identical altered-snapshot mismatch (1.14%) on target main; this PR changes only Android handler code/tests.
  • 🟡 Needs human investigation — MacCatalyst DragAndDropWithAnElementThatIsRemoved: element timeout lacks an equivalent failure in the five sampled main runs; incomplete history cannot establish absence. Compare the failing screenshot/element lookup with the same Mac configuration on main.
  • Insufficient data — Latest failed Windows Layout, Windows Entry, and Android Shadow job diagnostics were not captured; earlier setup errors cannot clear these legs.

🧭 Follow-up — actions and refresh

Next action: Restore the missing latest-attempt logs and investigate the Mac drag/drop timeout before attributing the remaining failures.

Maintainers: comment /review tests to refresh this report.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expert Review — 0 findings

Reviewed commit 31b067c.

@MauiBot

MauiBot commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@Vignesh-SF3580 — existing-test verification for commit 31b067c7.

Result PASSED Platform Android Commit 31b067c7


🧪 Gate analysis — click to expand

✅ Passed. The selected verification satisfied the gate's passing conditions. Unmatched, skipped, or inconclusive groups are not passing evidence.

📱 Device tests
Test group Without fix With fix
ScrollViewHandlerTests (ContentReparentsWhenHandlerIsRecreated, UpdatedContentReparentsIntoExistingInsetPanel) ✅ Failed as expected (360s) ✅ Passed (352s)
Execution log excerpts

Without fix ScrollViewHandlerTests (ContentReparentsWhenHandlerIsRecreated, UpdatedContentReparentsIntoExistingInsetPanel)

"totalMemoryBytes": 8322981888
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.core.devicetests'..
info: Successfully uninstalled com.microsoft.maui.core.devicetests
XHarness exit code: 1 (TESTS_FAILED)
  Passed: 0
  Failed: 2
  Skipped: 0
  Total: 2
  Tests completed with exit code: 1

With fix ScrollViewHandlerTests (ContentReparentsWhenHandlerIsRecreated, UpdatedContentReparentsIntoExistingInsetPanel)

396000,
            "totalMemoryBytes": 8322981888
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.core.devicetests'..
info: Successfully uninstalled com.microsoft.maui.core.devicetests
XHarness exit code: 0
  Passed: 2
  Failed: 0
  Skipped: 0
  Total: 2
  Tests completed successfully

PR head: 31b067c7.

Without-fix baseline: 13832fce.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 10, 2026
@kubaflo
kubaflo changed the base branch from main to candidate/11.0.1xx-sr2 November 11, 2026 22:04
@kubaflo
kubaflo merged commit 44b41d2 into dotnet:candidate/11.0.1xx-sr2 Nov 11, 2026
143 of 176 checks passed
kubaflo added a commit that referenced this pull request Nov 13, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
… native content (#39759)

<!-- 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!

### Issue Detail
On Android, a ScrollView can crash when its handler attaches content to
an internal container:
Java.Lang.IllegalStateException: The specified child already has a
parent.
 
### Root cause
The handler adds native content to an inset container without first
detaching it from its existing parent.
Removing the ScrollView's immediate children does not detach content
nested inside those containers. Android throws an exception when adding
a view that already has a parent, as each native view can have only one
parent.
 
### Description of Change
Call nativeContent.RemoveFromParent() before adding the content in both
scenarios:

- Creating a new inset container.
- Replacing content in an existing inset container.

This safely reparents the existing content without changing the
measurement or scrolling logic.

### Issues Fixed

Fixes #39758

### Screenshot

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="850" height="350"
src="https://github.com/user-attachments/assets/ce58d0f3-a797-4eaa-af8e-0404cfdb8cda">
| <img width="350" height="350"
src="https://github.com/user-attachments/assets/8786d5fe-3b01-4020-9cb9-2aa461919d92">
|

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Net11] [Android] Shell handler crashes when FlyoutContentTemplate contains a ScrollView

6 participants