Bug 58915 - Setting Entry.Text to a non-empty string causes height to be smaller than the text when VerticalOptions="End"
Summary: Setting Entry.Text to a non-empty string causes height to be smaller than the...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-21 04:35 UTC by Nicholas Bauer
Modified: 2017-09-18 14:05 UTC (History)
2 users (show)

Tags: verticaloptions, masterdetailpage, detail, ac
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot - Provided XAML on 2.4.0-pre1 (7.60 KB, image/png)
2017-08-21 12:21 UTC, Paul DiPietro [MSFT]
Details
Screenshot of bug (9.25 KB, image/png)
2017-08-24 19:37 UTC, Nicholas Bauer
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 for Bug 58915 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Nicholas Bauer 2017-08-21 04:35:53 UTC
Working: <Entry Text="" FontSize="Medium" VerticalOptions="End" />

Broken: <Entry Text="N" FontSize="Medium" VerticalOptions="End" />

What happens: the Entry box is too short to display the bottom half of the text when Text is initially set. If Text starts out empty, the box is sized correctly.
Comment 1 Paul DiPietro [MSFT] 2017-08-21 12:20:17 UTC
I'm unable to reproduce this on 2.4.0-pre1 using the XAML as provided (being inside or outside of a StackLayout makes no difference), so if you can please upload a reproduction project and provide more information about your environment, it would be appreciated, or we will otherwise have to mark this as not reproducible.
Comment 2 Paul DiPietro [MSFT] 2017-08-21 12:21:00 UTC
Created attachment 24327 [details]
Screenshot - Provided XAML on 2.4.0-pre1
Comment 3 Nicholas Bauer 2017-08-24 19:37:59 UTC
Created attachment 24408 [details]
Screenshot of bug

Bug showing on my system on 2.4.0.266-pre1
Comment 4 Nicholas Bauer 2017-08-24 19:40:45 UTC
New finding: It is normal when contained in a vertical StackLayout, but defective in a horizontal StackLayout.
Comment 5 Nicholas Bauer 2017-09-15 17:44:46 UTC
Reopening as info was provided
Comment 6 Paul DiPietro [MSFT] 2017-09-16 16:24:54 UTC
Simply using the following, it still looks the same:

    <StackLayout Orientation="Horizontal">
        <Entry Text="N" FontSize="Medium" VerticalOptions="End" />
    </StackLayout>

Please upload a project when you get a moment, because I have to imagine that there is some different code being used here?
Comment 7 Nicholas Bauer 2017-09-16 17:14:02 UTC
The bug happens when Text is unset or empty.
Comment 8 Nicholas Bauer 2017-09-16 17:14:28 UTC
Oh! wait hang on.
Comment 9 Nicholas Bauer 2017-09-16 17:15:01 UTC
Sorry got confused; it is when set. I'll see if I can upload something shortly.
Comment 10 Nicholas Bauer 2017-09-16 20:39:37 UTC
Bug does appear in my main project still, but not in a fresh project. I'll narrow down what's happening.
Comment 11 Nicholas Bauer 2017-09-17 06:27:27 UTC
Okay, traced it down... It *only* happens if it is in a page in the Detail pane of a MasterDetailPage. Keeping in mind that the Detail pane is a NavigationPage, a top-level NavigationPage does not show this problem.

So weird.

App.xaml.cs:
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace LabSidekicks.Hemocytometer
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();

            var masterPage = new MasterDetailPage1();

            MainPage = masterPage;
        }
    }
}


MasterDetailPage1.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.MasterDetailPage1"
             xmlns:pages="clr-namespace:MyApp"
             Icon="icon.png">
  <MasterDetailPage.Master>
        <pages:MainPage />
  </MasterDetailPage.Master>
  <MasterDetailPage.Detail>
    <NavigationPage>
      <x:Arguments>
        <pages:MainPage />
      </x:Arguments>
    </NavigationPage>
  </MasterDetailPage.Detail>
</MasterDetailPage>


MainPage.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.MainPage"
             Title="MainPage"
             x:Name="root">
    
    <StackLayout>
        <StackLayout Orientation="Horizontal">
            <Entry Text="N" VerticalOptions="End" FontSize="Medium" />
        </StackLayout>
        <StackLayout Orientation="Horizontal">
            <Entry VerticalOptions="End" FontSize="Medium" />
        </StackLayout>
    </StackLayout>

</ContentPage>



I believe that will do it. MainPage when contained in Master is correctly rendered, but not when contained in Detail.
Comment 12 Paul DiPietro [MSFT] 2017-09-18 14:05:01 UTC
Yes, that does it. Thank you for looking into it to find out the specific scenario.