Skip to content

Button with ImageSource doesn't render correctly when initially hidden #18655

@zwikk

Description

@zwikk

Description

Consider a hidden button (IsVisible = false) with an ImageSource. When this button is made visible, the button doesn't render correctly and doesn't respond to user taps.

Observations

  • The bug is iOS only, does not appear on Android.
  • It looks like this bug was introduced in the latest 8.0-rc.2.9530. It worked fine before in MAUI
  • There is a workaround. Adding a MinimumWidthRequest and MinimumHeightRequest seems to work. See also attached repro project.

Steps to Reproduce

  1. Make sure you are on the latest maui rc2 (8.0-rc.2.9530).
  2. Create new MAUI app
  3. Add a button named Btn1 with an ImageSource and IsVisible = false
  4. Add a second button with a clicked event handler
  5. In the clicked event handler set the IsVisible of Btn1 to true.
  6. Observe the bug that Btn doesn't respond to user taps, and doesn't render the image.

Link to public reproduction project repository

https://github.com/zwikk/maui-playground/tree/main/Source/ButtonImageSource

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-rc.2.9511

Affected platforms

iOS

Affected platform versions

iOS 16/17

Did you find any workaround?

There is a workaround. Adding a MinimumWidthRequest and MinimumHeightRequest seems to work. See also attached repro project.

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

area-controls-buttonButton, ImageButtonfixed-in-8.0.6Look for this fix in 8.0.6 SR1!i/regressionThis issue described a confirmed regression on a currently supported versionplatform/iost/bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions