Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Material] TextBox & PasswordBox Size Issue #835

Closed
3 of 6 tasks
Soap-141 opened this issue Aug 22, 2022 · 1 comment · Fixed by #838
Closed
3 of 6 tasks

[Material] TextBox & PasswordBox Size Issue #835

Soap-141 opened this issue Aug 22, 2022 · 1 comment · Fixed by #838
Assignees
Labels
kind/bug Something isn't working

Comments

@Soap-141
Copy link
Contributor

Current behavior

When a TextBox or a PasswordBox using the Material OutlinedStyle and has content receives focus, it probably changes some of its template sizes and it makes the content move to the right by a couple pixels.

Animation_53

Expected behavior

The content should not be moved when those controls receive focus.

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

  1. Download SampTextAndPassBox.zip
  2. Open the solution
  3. Start the application
  4. Fill the PasswordBox and the TextBox
  5. Click on both of them
  6. Notice that the content seems to be moving to the right

Environment

Nuget Package: Uno.Material.WinUI

Package Version(s): 2.3.0-dev.6

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • UWP
  • WinUI
  • MacOS

Anything else we need to know?

N/A

@Soap-141 Soap-141 added the kind/bug Something isn't working label Aug 22, 2022
@Xiaoy312
Copy link
Contributor

reason being the focused visual-state make the border thickness bolder (1->2)
this in turn shrink the inner contents (icon, text, delete button ...) space by that much

<Border x:Name=RootBorder 
		BorderBrush=TemplateBinding BorderThickness=TemplateBinding 
		CornerRadius=TemplateBinding
		Padding=1> <!-- !!! -->
    <Grid Padding=TemplateBinding>
         <!- rest of stuff ... -->
         

<VisualState x:Name="PointerOver">
	  <VisualState.Setters>
		    <Setter Target="RootBorder.BorderThickness" Value="2" />
		    <Setter Target="RootBorder.Padding" Value="0" /> <!-- !!! -->
		    <!-- ... -->
	  </VisualState.Setters>
</VisualState>

^ so long as we balance the total shrinkage (border-thickness+corner-radius+padding=const) the inner contents should not move

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants