CommunityToolkit / CommunityToolkit/Maui

[BUG] Expander: BoxView Inside expander isn't rendered on iOS

Open
#2,831 0 comments 0 reactions 0 assignees View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

We use Expander component and inside it we use a BoxView with HeightRequest = 1, as a seperator. On iOS, the BoxView isn't rendered. If I switch from white to dark mode ** while the Expander is expanded**, it is rendered successfully.
On Android this behavior is not reproduced

I have created a sample repository, this bug is also reproduced on our production app.

iOS:
https://github.com/user-attachments/assets/aed18af9-b604-46bf-87bf-0973ce64b170

Android:
https://github.com/user-attachments/assets/28fb749f-7a8c-4b34-9abb-30093b7429ba

### Expected Behavior

The Boxview should be correctly rendered on iOS when inside an expander (as it does on Android)

### Steps To Reproduce

1. Download repo on Mac and Build on iOS
2. Expand expander(the boxview is not rendered)
3. Switch to dark mode
4. The boxview is rendered

### Link to public reproduction project repository

https://github.com/cvchris/CommunityToolkit.Maui.ExpanderBug

### Environment

```markdown
- .NET MAUI CommunityToolkit: 12.1.0
- OS: iOS 18.5 / Android 15
- .NET MAUI:
.Net Maui 9.0.90
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the public reproduction project, CommunityToolkit.Maui.ExpanderBug, and build it on iOS using the reported .NET MAUI and CommunityToolkit versions. Reproduce the Expander with a one-pixel BoxView, then compare the iOS and Android behavior. Done means the BoxView renders when the Expander is opened on iOS without requiring a dark-mode switch.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.