Skip to content

Fix layout when MinimumWidth/HeightRequest is removed on Windows#24639

Merged
spadapet merged 3 commits into
mainfrom
dev/peterspa/ClearMinimumSizeRequest
Sep 8, 2024
Merged

Fix layout when MinimumWidth/HeightRequest is removed on Windows#24639
spadapet merged 3 commits into
mainfrom
dev/peterspa/ClearMinimumSizeRequest

Conversation

@spadapet

@spadapet spadapet commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

Description of Change

ViewExtensions.UpdateMinimumHeight|Width for WinUI is supposed to update FrameworkElement.MinHeight|Width based on the MAUI property MinimumHeightRequest/MinimumWidthRequest. But it would completely skip the update when the value was removed, so the previously set value would stay in effect. That locks in the old FrameworkElement.MinHeight|Width, and layout doesn't change.

The fix is to remove FrameworkElement.MinHeight|Width when MinimumHeightRequest/MinimumWidthRequest is removed.

Issues Fixed

Fixes #24638

@spadapet spadapet self-assigned this Sep 6, 2024
@spadapet spadapet requested a review from a team as a code owner September 6, 2024 22:59

@PureWeen PureWeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spadapet

spadapet commented Sep 7, 2024

Copy link
Copy Markdown
Contributor Author

test is faiing

https://dev.azure.com/xamarin/public/_build/results?buildId=123366&view=ms.vss-test-web.build-test-results-tab&runId=3123614&resultId=100011&paneView=debug

Ack, the test passed locally on Windows and Android. Maybe I need to request a smaller min width/height since the height ended up being 486 instead of 500.

@PureWeen

Comment thread src/Controls/tests/DeviceTests/Elements/Layout/LayoutTests.cs Outdated
@spadapet spadapet enabled auto-merge (squash) September 8, 2024 18:00
@spadapet spadapet merged commit cf00253 into main Sep 8, 2024
@spadapet spadapet deleted the dev/peterspa/ClearMinimumSizeRequest branch September 8, 2024 18:45
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@samhouts samhouts added fixed-in-9.0.0-rc.2.24503.2 and removed fixed-in-net9.0-nightly This may be available in a nightly release! labels Oct 14, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When MinimumWidthRequest or MinimumHeightRequest are cleared on Windows, the old values stay in effect

3 participants