Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsVisible doesn't work anymore #8044

Closed
HausBJB opened this issue Jun 15, 2022 · 48 comments
Closed

IsVisible doesn't work anymore #8044

HausBJB opened this issue Jun 15, 2022 · 48 comments
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-6.0.408 Look for this fix in 6.0.408! i/regression This issue described a confirmed regression on a currently supported version legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor p/0 Work that we can't release without platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@HausBJB
Copy link

HausBJB commented Jun 15, 2022

Description

After updating to Sr1, binding to IsVisible no longer works
iOS & MacOS works

I've asked before and will try again

Since a lot of things no longer work for me with this version, I wanted to know how I can get the penultimate version
Android
Android

iOS
ios

Steps to Reproduce

1.Use Repro https://github.com/HausBJB/MauiApp3.git
2.Run
3.Click to Click me
4. image is not displayed
5. But the text changes

Version with bug

6.0.400 (current)

Last version that worked well

6.0.312

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

No response

Relevant log output

No response

@HausBJB HausBJB added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jun 15, 2022
@jsuarezruiz jsuarezruiz added fatal i/regression This issue described a confirmed regression on a currently supported version labels Jun 15, 2022
@enisn
Copy link

enisn commented Jun 15, 2022

@ederbond
Copy link
Contributor

The same here with the latest version (6.0.400). My whole application is now broken.

@jsuarezruiz jsuarezruiz self-assigned this Jun 15, 2022
@HausBJB
Copy link
Author

HausBJB commented Jun 15, 2022

Yes, and development will probably have to be postponed until the next version comes out

@jfversluis jfversluis added legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 15, 2022
@Giuseppetm
Copy link

Giuseppetm commented Jun 15, 2022

Same here, this is a huge problem.

@manuelelucchi
Copy link

I find disappointing and concerning that this release, after 3 weeks of known bugs, doesn't fix anything important and instead introduces new fatal bugs. In our application we had

And what is annoying the most is that we opened issues and there are even pull requests that fixes them opened since days that no one closed and so they didn't end up in SR1, making us wait WEEKS for them

I really like Xamarin and of course I like Maui more for how many things it improved, but it's really frustrating to develop with it knowing that each new release is going to break more things than it fixes

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jun 15, 2022

Some related issues with IsVisible

IsVisible property wasn't working well before,

I don't think they're related, but I'll check it out. The first two ones will be fixed with #6892

@HausBJB
Copy link
Author

HausBJB commented Jun 15, 2022

Yes, and the comments are now filtered, although no one offended anyone

@jsuarezruiz
Copy link
Contributor

Can reproduce the issue. Is a really critical one. I'm going to try to move it as fast as possible.

@jsuarezruiz jsuarezruiz added this to the 6.0-sr2 milestone Jun 15, 2022
@jsuarezruiz jsuarezruiz added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Jun 15, 2022
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jun 15, 2022

Initial feedback from a quick review:

  • The native property of the control, Visibility, sets the ViewStates correctly (Visible, Gone etc). In fact, this is validated by tests added when the property was implemented:

    public virtual async Task SetVisibility(Visibility visibility)
    This tests run with each View (Label, Button etc).

  • If the value of the bool property that manage the visibility is initially false, this happens:

fix-8044-01

  • If, on the other hand, the bool property that manage the visibility is initially true, this happens:

fix-8044-02

With the above, I suspect that the problem could be related to Layouts. We need to investigate it more.

@jsuarezruiz jsuarezruiz added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jun 15, 2022
@manuelelucchi
Copy link

@jsuarezruiz While we wait for the fix, is there a way to regress the maui version? Can we choose the workload version manually? Since maui is not a nuget package...

BTW, how is the plan for maui updates from the GA and going on? One every 2-3 weeks like dotnet stable? isn't it a little too much for a new project that has tons of issue to fix?

Thank you for your work

@jsuarezruiz
Copy link
Contributor

@jsuarezruiz While we wait for the fix, is there a way to regress the maui version? Can we choose the workload version manually? Since maui is not a nuget package...

BTW, how is the plan for maui updates from the GA and going on? One every 2-3 weeks like dotnet stable? isn't it a little too much for a new project that has tons of issue to fix?

Thank you for your work

There is no official documentation to downgrade workloads. The Development Wiki can help you https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md. Sorry for the inconvenience, maybe we can find a workaround for this.

Regarding the pace of releases, yes, will be with dotnet releases.

@manuelelucchi
Copy link

@jsuarezruiz While we wait for the fix, is there a way to regress the maui version? Can we choose the workload version manually? Since maui is not a nuget package...

BTW, how is the plan for maui updates from the GA and going on? One every 2-3 weeks like dotnet stable? isn't it a little too much for a new project that has tons of issue to fix?

Thank you for your work

There is no official documentation to downgrade workloads. The Development Wiki can help you https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md. Sorry for the inconvenience, maybe we can find a workaround for this.

Regarding the pace of releases, yes, will be with dotnet releases.

To be honest not being able to choose the workload version seems like a big problem for new projects like Maui that aren't exactly stable

@ederbond
Copy link
Contributor

Come on MSFT, you guys should re-think this strategy to release new versions of MAUI tied to VS/.NET releases.
MAUI is far from stable, in fact it's too buggy at this moment. You guys have released it as GA telling us that it's ready for production but that's so not true, very basic things simply just doesn't work. Look that the number of open issues that you already have on this git repo, and the small number of official team members. I was hopping that MAUI would be better then XF in terms of quality and reliability but it's not, it's worst at this moment.

@Vpatel541
Copy link

My application is also broken as IsVisible being set to false initially causes none of my slide menus to function properly

@TwoTicketsPls
Copy link

TwoTicketsPls commented Jun 15, 2022

Seeing this on Android 11 & 12. Using Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.3.0 Preview 2.0.

All good if bound property is initially set to true. Otherwise not.

Edit: But not binding related apparently, as setting IsVisible manually in code behind gives the same results.

@ajphall
Copy link

ajphall commented Jun 28, 2022

For those struggling to work around this, there are some instructions here https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md that kind of explain how to get a nightly build. However, I found they were quite confusing and incomplete. If you want to try a nightly build here is what I did.

Run the command found on the DEVELOPMENT.md page:

dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/net6.0.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --include-previews

(I added the --include-previews I'm not sure if this is necessary)

This seems to install the latest nightly build version of the workload

Open the file https://aka.ms/dotnet/maui/net6.0.json in your browser. There is a line: "microsoft.net.sdk.maui": "6.0.500-preview.1.6059/6.0.300",

Now go into your csproj files and add the version number from the net6.0.json file in a PropertyGroup, e.g.:

<MauiVersion>6.0.500-preview.1.6059</MauiVersion>

Now IsVisible is working again.

Hopefully that helps people out - good luck..

@HobDev
Copy link

HobDev commented Jun 28, 2022

This issue could be related.

@fabio-popup
Copy link

Same issue here :( my whole app is broken now.

@mobilewares

This comment was marked as off-topic.

@Telavian

This comment was marked as off-topic.

@mobilewares

This comment was marked as off-topic.

@Telavian

This comment was marked as off-topic.

@mobilewares

This comment was marked as off-topic.

@naweed

This comment was marked as off-topic.

@naweed

This comment was marked as off-topic.

@AndreduToit

This comment was marked as off-topic.

@yousufctec
Copy link

yousufctec commented Jun 29, 2022

This bug made me think choosing .NET MAUI at this earlier stage is a blunt mistake. We wasted few man-days on this.

@8m0
Copy link

8m0 commented Jun 29, 2022

We were able to work around and continue development by setting the Height property of a Grid.RowDefinition to 0 initially, and then toggling to the desired height to show the contained controls. Haven't checked to see if this 'Height hack' will work with other controls, but at least we are able to keep developing until this IsVisible issue gets resolved.

With rowdef children inside of a grid is visible, so you need to hide them as well which is a bumer, especially if you want to DRY.

@fabio-popup
Copy link

fabio-popup commented Jul 1, 2022

Just for now, in order to work, I setted <MauiVersion>6.0.312</MauiVersion> in project and eventually installed workloads with dotnet workload restore
Obviously with these solution the problem doesn't use a prerelease and opfully it's more stable.
Hope this can help someone else

@Schinwinkwinsky
Copy link

Just for now, in order to work, I setted <MauiVersion>6.0.312</MauiVersion> in project and eventually installed workloads with dotnet workload restore Obviously with these solution the problem doesn't use a prerelease and opfully it's more stable. Hope this can help someone else

I was confusing the Maui version with Dotnet version. I was setting <MauiVersion>6.0.301</MauiVersion> that's the last stable Dotnet version on my machine.

image

But what we can consider is the Maui version and I don't know why the default on VS 2022 Preview is 6.0.500-preview.1.6059.

image

image

If we look for "Maui.Core" on nuget we can find some stable versions.

image

I set <MauiVersion>6.0.400</MauiVersion> and the last issues I've faced were gone. I'll wait for next stable version.

image

@SpaaJ
Copy link

SpaaJ commented Jul 3, 2022

After 2 days of search .. the trick call Arrange() after IsVisible modifications:

Exemple :

public async Task StartFaceAnimation()
    {
        Dispatcher.Dispatch(() =>
        {
            FaceNormal.IsVisible = true;
            FaceLoose.IsVisible = false;
            Arrange(new Rect());
        });
        await Task.Delay(2000);
        Dispatcher.Dispatch(() =>
        {
            FaceNormal.IsVisible = false;
            FaceLoose.IsVisible = true;
            Arrange(new Rect());
        });
    }

It redraws the controls !

@8m0
Copy link

8m0 commented Jul 4, 2022

After 2 days of search .. the trick call Arrange() after IsVisible modifications:

Exemple :

public async Task StartFaceAnimation()
    {
        Dispatcher.Dispatch(() =>
        {
            FaceNormal.IsVisible = true;
            FaceLoose.IsVisible = false;
            Arrange(new Rect());
        });
        await Task.Delay(2000);
        Dispatcher.Dispatch(() =>
        {
            FaceNormal.IsVisible = false;
            FaceLoose.IsVisible = true;
            Arrange(new Rect());
        });
    }

It redraws the controls !

2 days Carl.... :) .... of random methods cycle :)

@mobilewares
Copy link

Hey @ajphall (or others) :

I used your technique above last week and it was working/ I was able to run my App :

For those struggling to work around this, there are some instructions here https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md that kind of explain how to get a nightly build. However, I found they were quite confusing and incomplete. If you want to try a nightly build here is what I did.

Run the command found on the DEVELOPMENT.md page:

dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/net6.0.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --include-previews

(I added the --include-previews I'm not sure if this is necessary)

This seems to install the latest nightly build version of the workload

Open the file https://aka.ms/dotnet/maui/net6.0.json in your browser. There is a line: "microsoft.net.sdk.maui": "6.0.500-preview.1.6059/6.0.300",

Now go into your csproj files and add the version number from the net6.0.json file in a PropertyGroup, e.g.:

<MauiVersion>6.0.500-preview.1.6059</MauiVersion>

Now IsVisible is working again.

Hopefully that helps people out - good luck..

Then, I (foolishly) decided to try and grab an updated nightly build using same technique a couple of days ago (and again today) :

  • Deleted my bin/obj folders
  • ran the dotnet workload install command above
  • grabbed the latest maui version number from that URL (which is currently '6.0.500-preview.1.6118') and updated the MauVersion in my .csproj file as I did before..

Now when I load the solution and try to compile it I'm getting the error (one of therse for each target) :

Assets file '\obj\project.assets.json' doesn't have a target for 'net6.0-android'. Ensure that restore has run and that you have included 'net6.0-android' in the TargetFrameworks for your project.

And I've not been able to get past this since.. (retried this last 3 days with nightly build numbers) and keep getting same error. I also tried the 'dotnet nuget locals all --clear' command from that Developement.md doc just in case that would help plus trying to do dotnet workload restore variations.

Any ideas on how to get back to scenario where I can compile/run my app from the latest nightly build again?

thanks in advance if any ideas?

@victorsigga
Copy link

i'm still with this problem, when trying to set a button to false, don't work, but when trying to set an entry, it works fine.

@fabio-popup
Copy link

i'm still with this problem, when trying to set a button to false, don't work, but when trying to set an entry, it works fine.

In last VS 2022 Preview ( Version 17.3.0 Preview 4.0) this is fixed.

@victorsigga
Copy link

i'm still with this problem, when trying to set a button to false, don't work, but when trying to set an entry, it works fine.

In last VS 2022 Preview ( Version 17.3.0 Preview 4.0) this is fixed.

@fabio-popup i'm 5.0 and the issue still occurs. have you tested in windows ?

@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 2022
@samhouts samhouts added the fixed-in-6.0.408 Look for this fix in 6.0.408! label Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-6.0.408 Look for this fix in 6.0.408! i/regression This issue described a confirmed regression on a currently supported version legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor p/0 Work that we can't release without platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests