Skip to content

Button control's IsEnabled property not works if used with Command property.  #16947

@divyesh008

Description

@divyesh008

Description

In Button control I've used IsEnabled property with Command property and noticed one issue. IsEnabled property is not working. Though we set IsEnabled=False when we run the app and check the button remains enable.

Steps to Reproduce

  1. Create new project and take button control in the page.
  2. Set IsEnabled=false and Command property together in button control.
  3. Now run the app and check, you'll notice that Button control is still enabled which is wrong.
  4. Remove the Command property and run the app again and now button will be disabled which is correct.

Link to public reproduction project repository

https://github.com/divyesh008/Button_IsEnabled_Bug.git

Version with bug

7.0.92

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 16.1, Android 11

Did you find any workaround?

Yes, there are 2 workaround we have.

  1. Use Clicked property of button control
  2. User GestureRecognizers => TapGestureRecognizer

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-buttonButton, ImageButtonmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertp/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/androidplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions