Bug 41740 - Grid ignores MinimumWidthRequest
Summary: Grid ignores MinimumWidthRequest
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.2.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-12 00:09 UTC by Dominik Weber
Modified: 2017-06-16 15:44 UTC (History)
6 users (show)

Tags: backcompat, ac
Is this bug a regression?: ---
Last known good build:


Attachments
test project (229.84 KB, application/x-zip-compressed)
2016-06-12 00:09 UTC, Dominik Weber
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Dominik Weber 2016-06-12 00:09:27 UTC
Created attachment 16290 [details]
test project

The Grid layout ignores the MinimumWidthRequest property. An empty Grid with MinimumWidthRequest=100 will be rendered with 0px width.

In the attached test project there should be 3 colored vertical bars:

- red: Grid, WidthRequest=100
- yellow: Grid, MinimumWidthRequest=100
- green: Label

however only red and green are visible.
Comment 1 Dominik Weber 2016-06-12 00:12:34 UTC
This bug also exists in XF 2.3.0.46-pre3
Comment 2 Jason Smith [MSFT] 2016-06-14 17:49:15 UTC
Thank you for taking the time to submit this report. It is our policy to maintain backwards compatibility with existing apps to the best of our ability. Consequently, we must avoid modifying any functional UI behavior such as this. At this time, we will close and tag this issue for consideration in a future version of Xamarin.Forms.

Warm regards,
Xamarin Forms Team
Comment 3 Jason Smith [MSFT] 2016-06-14 17:50:10 UTC
Excuse me I misunderstood the original report! I am re-opening for further investigation.
Comment 4 adrianknight89 2016-09-27 11:23:53 UTC
See https://github.com/xamarin/Xamarin.Forms/pull/386
Comment 5 James Montemagno [MSFT] 2017-06-16 15:43:30 UTC
From my findings and reading the documentation I think that it is actually working as described: https://developer.xamarin.com/api/property/Xamarin.Forms.VisualElement.MinimumWidthRequest/ Since there is nothing in the grid the requested width/height is 0 so the minwidth/minheight don't come into effect .It is only when you set the height/width would they work. For instance this XAML which shrinks down smaller when the label gets longer, but never gets smaller than 20 width. I read through the actual github report and it seems as though this is what Jason was trying to state.