dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.22k stars 1.75k forks source link

Changing visibility in child elements does not work #25154

Open grabnerM opened 1 month ago

grabnerM commented 1 month ago

Description

Hi,

currently our MAUI-team is facing a new issue. It´s a little bit complicated to explain, so read carefully. We got an FooterView with an indexBar (this indexBar represents a list of questions. So every question got an own button to jump to the exact question). This indexBar can be expanded and collapsed - or in other words shown and hidden. To achieve this, we set the visibility to "True" or "False". One feature of our app is to mark questions. If a question gets marked, the button in the indexBar connected with the current question, should show an yellow circle. Now comes the part where the error occurs. If the indexBar is expanded (visible), the circle does get drawn totally fine. But if i mark the question and the indexBar is currently collapsed (hidden) and i expand the indexBar, the circle is not visible.

I hope the problem is more or less understandable 😅

I believe the problem has something to do, that the visibility of elements can´t be changed, if the parent element is already hidden. But in my opinion the visibility of the child elements should be also rerendered, if the parents visibility gets set to "True".

By the way, in Xamarin this worked totally fine...

Steps to Reproduce

  1. Put a label into a StackLayout
  2. Set the visibility of both elements to False
  3. Change the visibility of the inner element (label) to True (via code - in our case it got set via a bindableProperty)
  4. Change the visibility of the outer element (StackLayout) to True (also via code)

Expected outcome: both elements should be visible Actual outcome: only the StackLayout gets visible

Link to public reproduction project repository

No response

Version with bug

8.0.90 SR9

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

jaosnz-rep commented 3 weeks ago

@grabnerM Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

dotnet-policy-service[bot] commented 4 days ago

Hi @grabnerM. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.