When you put the focus on the TextBoxErrorControl, the clear button appears and the text is push too far from the clear button.
When you put the focus on the TextBoxErrorControl, the clear button appears and the text is moved next to the button
Sample:
TextBoxAlignmentIssueSample.zip
Nuget Package:
Uno.UI
Package Version(s):
2.1.0-dev.509
Affected platform(s):
Visual Studio:
Relevant plugins:
@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.
@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
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.
@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
I found the cause of the problem: it's a resource issue.
==> May be fixed by PR https://github.com/unoplatform/uno/pull/1766. @davidjohnoliver ?
<Button> defined this way:xml
<Style x:Key="DefaultButtonStyle" TargetType="Button">
<Setter Property="MinWidth" Value="128" />
</Style>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}" />
xml
<Button Style="{StaticResource DeleteButtonStyle}"
Width="24"
Padding="4,0,0,0"
HorizontalAlignment="Right" />
DeleteButtonStyle is defined like that...xml
<Style x:Key="DeleteButtonStyle" TargetType="Button">
<Setter Property="Width" Value="40" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
</Style>
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.This wasn't happening before because MinWidth, MaxWidth, MinHeight & MaxHeight were not properly calculated in the past.
Add a setter for MinWidth on DeleteButtonStyle to override the default one coming from DefaultButtonStyle.
Most helpful comment
Investigations
I found the cause of the problem: it's a resource issue.
==> May be fixed by PR https://github.com/unoplatform/uno/pull/1766. @davidjohnoliver ?
Explanation
<Button>defined this way:xml <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)
xml <Button Style="{StaticResource DeleteButtonStyle}" Width="24" Padding="4,0,0,0" HorizontalAlignment="Right" />DeleteButtonStyleis defined like that...xml <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
MinWidthof0... like if theDeleteButtonStylewere not having an implicitBaseOnon the default style, which is the case on Uno Platform. Actually, on Uno, the<Button>will have aMinWidth=128, causing the reported bug.Why it's a regression
This wasn't happening before because
MinWidth,MaxWidth,MinHeight&MaxHeightwere not properly calculated in the past.Workaround
Add a setter for
MinWidthonDeleteButtonStyleto override the default one coming fromDefaultButtonStyle.