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

Windows: Command ChangeCanExecute does not re-enable a disabled button #7690

Closed
Keflon opened this issue Jun 2, 2022 · 2 comments
Closed
Assignees
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@Keflon
Copy link

Keflon commented Jun 2, 2022

Description

UWP only: When binding an ICommand to a Button, if the ICommand disables the Button (e.g. during an await) and then re-enables the Button, the Button is drawn as if it is still disabled.

Repro here: https://github.com/Keflon/MauiCommandBugRepro

Steps to Reproduce

  1. Create a Command with the following handlers:
    private async void DoDelay()
    {
        PreventDelay = true;
        DelayCommand.ChangeCanExecute();
        await Task.Delay(1000);
        PreventDelay = false;
        DelayCommand.ChangeCanExecute();
    }

    private bool CanDoDelay()
    {
        return !PreventDelay;
    }
  1. Bind the Command to a Button.
  2. Click the Button.
  3. On UWP, the Button remains disabled after the delay completes.

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Latest

Did you find any workaround?

Not yet.

Relevant log output

No response

@Keflon Keflon added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jun 2, 2022
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jun 2, 2022
@jsuarezruiz jsuarezruiz changed the title UWP: Command ChangeCanExecute does not re-enable a disabled button Windows: Command ChangeCanExecute does not re-enable a disabled button Jun 3, 2022
@kristinx0211 kristinx0211 added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 7, 2022
@kristinx0211
Copy link

verified repro on windows using above project.

@jsuarezruiz jsuarezruiz self-assigned this Jun 17, 2022
@jsuarezruiz
Copy link
Contributor

Can reproduce the issue in the latest version but not in the current net6.0 branch.
issue-7690

The issue should be fixed in the upcoming release.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants