Skip to content

fix(controls): Fix PasswordBox various issues#1501

Merged
pomianowski merged 7 commits intolepoco:mainfrom
Nuklon:patch-17
Nov 7, 2025
Merged

fix(controls): Fix PasswordBox various issues#1501
pomianowski merged 7 commits intolepoco:mainfrom
Nuklon:patch-17

Conversation

@Nuklon
Copy link
Collaborator

@Nuklon Nuklon commented Aug 5, 2025

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

If you use a PasswordBox, and specify a default password (Password="Test" for example), or bind it to an existing password, the placeholder doesn't get removed and the clear button isn't updated.

image

What is the new behavior?

image

As one would expect.

@Nuklon Nuklon requested a review from pomianowski as a code owner August 5, 2025 12:04
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. PR Pull request dotnet release labels Aug 5, 2025
protected override void OnTextChanged(TextChangedEventArgs e)
{
UpdateTextContents(isTriggeredByTextInput: true);
SetPlaceholderTextVisibility();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should always be called to ensure the placeholder/clear button is in sync with the text.

@Nuklon Nuklon changed the title Fix PasswordBox not updating placeholder and clear button when initialized Fix PasswordBox various issues Aug 5, 2025
@github-actions github-actions bot added the styles Topic is related to styles label Aug 5, 2025
@Nuklon
Copy link
Collaborator Author

Nuklon commented Aug 5, 2025

2nd commit centers the buttons vertically, same as TextBox, so they look largely identical again.

Comment on lines -34 to -36
<Thickness x:Key="PasswordBoxLeftIconMargin">10,8,0,0</Thickness>
<Thickness x:Key="PasswordBoxRightIconMargin">0,8,10,0</Thickness>
<Thickness x:Key="PasswordBoxButtonMargin">0,5,4,0</Thickness>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical to TextBox now (copied from there).

@pomianowski pomianowski changed the title Fix PasswordBox various issues fix(controls): Fix PasswordBox various issues Nov 7, 2025
@Nuklon
Copy link
Collaborator Author

Nuklon commented Nov 7, 2025

Conflicts resolved.

@pomianowski pomianowski merged commit 20cb0dd into lepoco:main Nov 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. dotnet PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants