iOS: Rectangle that is invisible when page loads can never be made visible #27935
Labels
area-drawing
Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
partner/syncfusion
Issues / PR's with Syncfusion collaboration
platform/iOS 🍎
t/bug
Something isn't working
Milestone
Description
On iOS only, a
Rectangle
element'sIsVisible
property is bound to a false value when the page loads, then changing that property to true does not make it fully visible. To be more precise, any space the rectangle should have taken up will indeed be taken up when IsVisible is flipped to true, but the background color of the rectangle will remain transparent. On the other hand, a rectangle whose IsVisible was already true when the page loaded can have its visibility toggled back and forth with the expected result. The bug remains the same whether the bound property is updated through a command or a simple event handler.The bug is present on Maui 9.0.40 and 8.0.3-8.0.100. Likely present on earlier 9.0.x iterations but did not test those. Did not test anything prior to 8.0.3 either.
Another interesting observation is that the first time the rectangle is made visible, it is not the correct size, but is the second time.
The bug is not present on Android, which correctly makes the rectangle visible in all circumstances. (As a side note, it seems like the
HeightRequest
isn't always correctly observed on Android, but that would be a separate issue)This bug doesn't affect other components; for example, a button that is hidden on page load will still become visible as it should when the flag is toggled.
Video of Behavior
Screen.Recording.2025-02-20.114848.mp4
Steps to Reproduce
<ContentPage>
node to the following:Link to public reproduction project repository
https://github.com/RedZone908/ReproRectangleNeverVisible
Version with bug
9.0.40 SR4, 8.0.3 GA, 8.0.61 SR 6.1, 8.0.100 SR10, most likely all other 8.0.x and 9.0.x iterations.
Unknown if 6.0.x and 7.0.x are affected or not.
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
No response
Affected platforms
iOS
Affected platform versions
iOS 17, possibly others
Did you find any workaround?
The workaround at the moment is to make the rectangle briefly visible when the page loads but then make it invisible in an
OnAppearing
event handler after some number of milliseconds, like so:Relevant log output
The text was updated successfully, but these errors were encountered: