Skip to content

[iOS][Android][Wasm] The space between the text and the clear button is too wide #2430

Closed

Description

@carlh98

Current behavior

When you put the focus on the TextBoxErrorControl, the clear button appears and the text is push too far from the clear button.

Expected behavior

When you put the focus on the TextBoxErrorControl, the clear button appears and the text is moved next to the button

How to reproduce it (as minimally and precisely as possible)

Sample:
TextBoxAlignmentIssueSample.zip

Environment

Nuget Package:
Uno.UI

Package Version(s):
2.1.0-dev.509

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    platform/ios 🍎
    triage/untriaged
    on Jan 3, 2020
  2. added this to the 2.1 milestone on Jan 4, 2020
  3. added
    kind/regression
    and removed
    triage/untriaged
    on Jan 7, 2020
  4. self-assigned this
    on Jan 30, 2020
  5. carldebilly commented on Feb 4, 2020

    @carldebilly
    Member

    @carlh98
    It has not been tested yet, but the package Uno.UI v2.1.0-dev.1090 contains fixes related to this issue and it should be tested again on this version.

  6. carlh98 commented on Feb 4, 2020

    @carlh98
    ContributorAuthor

    @carldebilly
    There's a new regression for the sample TextBoxAlignmentIssueSample.zip with Uno.UI 2.1.0-dev.1097, the control is present in the View Hierarchy but not visible in the app

  7. carldebilly commented on Feb 27, 2020

    @carldebilly
    Member

    PR #2679 has been merged, producing Uno.UI v2.1.0-dev.1371 which should be available soon on Nuget there: https://www.nuget.org/packages/Uno.UI/2.1.0-dev.1371. This issue could be fixed by those changes and need to be tested again with this version of Uno.UI.

    Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
  8. changed the title [-][iOS] The space between the text and the clear button is too wide[/-] [+][iOS][Android][Wasm] The space between the text and the clear button is too wide[/+] on Feb 27, 2020
  9. carlh98 commented on Feb 27, 2020

    @carlh98
    ContributorAuthor

    @carldebilly
    With Uno.UI 2.1.0-dev.1371:
    (Regression) In iOS, the TextBoxErrorControl does not appear on screen, you can click on the TextBoxErrorControl area where it's supposed to appear to show the tactile keyboard
    (Same) In Android and Wasm it's the same as 2.1.0-dev.509

  10. carldebilly commented on Mar 4, 2020

    @carldebilly
    Member

    Investigations

    I found the cause of the problem: it's a resource issue.

    ==> May be fixed by PR #1766. @davidjohnoliver ?

    Explanation

    1. There's a Default Style on <Button> defined this way:
      <Style x:Key="DefaultButtonStyle" TargetType="Button">
      	<Setter Property="MinWidth" Value="128" />
      </Style>
      <Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}" />
      (more properties are defined... but they are not relevant to this bug)
    2. The control is defined this way...
      <Button Style="{StaticResource DeleteButtonStyle}"
      	Width="24"
      	Padding="4,0,0,0"
      	HorizontalAlignment="Right" />
    3. The DeleteButtonStyle is defined like that...
      <Style x:Key="DeleteButtonStyle" TargetType="Button">
      	<Setter Property="Width" Value="40" />
      	<Setter Property="Padding" Value="0" />
      	<Setter Property="Margin" Value="0" />
      </Style>

    On UWP, the result control will get a MinWidth of 0... like if the DeleteButtonStyle were not having an implicit BaseOn on the default style, which is the case on Uno Platform. Actually, on Uno, the <Button> will have a MinWidth=128, causing the reported bug.

    Why it's a regression

    This wasn't happening before because MinWidth, MaxWidth, MinHeight & MaxHeight were not properly calculated in the past.

    Workaround

    Add a setter for MinWidth on DeleteButtonStyle to override the default one coming from DefaultButtonStyle.

  11. removed this from the 2.1 milestone on Mar 4, 2020
  12. linked a pull request that will close this issueStyles and Xaml resources compatibility #1766on Mar 4, 2020
  13. removed their assignment
    on Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugkind/regressionplatform/ios 🍎

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions