Skip to content

Conversation

@jbryknar
Copy link
Collaborator

@jbryknar jbryknar commented Jun 16, 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?

  • When pasting or typing the PasswordChar (e.g. " * ") into the PasswordBox, the character is incorrectly discarded.
  • This occurs because the input processing logic assumes any occurrence of the PasswordChar in the Text property is a masking symbol and not actual user input
  • As a result, characters matching the masking symbol cannot be used in passwords, and any pasted text containing such characters gets silently altered. Revealing the password also shows the text without the originally entered or pasted *, leading to data loss and unexpected behavior.

Before Fix

PasswordBox_BeforeFix

Issue Number: #1250 and #1148

What is the new behavior?

The PasswordBox now properly distinguishes between masking and actual input. Characters identical to the PasswordChar, such as " * ", can now be entered or pasted as part of the password.

The internal logic no longer strips or ignores these characters during input or paste operations. When the password is revealed, it correctly displays all characters, including those matching the mask symbol.

After Fix

PasswordBox_AfterFix

Fixed unexpected icon behavior with multiple PasswordBoxes

PasswordBox_AfterFix_Issue_1148

Other information

N/A

QA

Testing Scenarios

Scenario Scenario Steps Expected Result Status
Type text with special characters in revealed mode In PasswordBox type Test#*{!ˇ12' The entered password will be displayed in the field Passed
Type text with special characters in hidden mode In PasswordBox type Test#*{!ˇ12' Wildcards will be displayed in the field. When you click on the reveal password button, the password entered by the user should be displayed. Passed
Testing Copy & Paste Action Write the password somewhere on the side (for example, Notepad) and then copy and paste it into the box. The password must contain special characters, including the wildcard character “ * ”. For example: Test*12@#!!( Paste this password into text field. After pasting and revealing the password with the push button, the password must be complete as it was originally copied to the clipboard. Passed
Testing Copy & Paste with Replace All Action Write the password somewhere on the side (for example, Notepad) and then copy and paste it into the box. The password must contain special characters, including the wildcard character “ * ”. For example: Test*12@#!!( Paste this password into field. Select all text (CTRL+A or manually with the cursor) and re-enter the password from clipbaord After pasting, clearing and revealing the password with the push button, the password must be complete as it was originally copied to the clipboard. Passed

@github-actions github-actions bot added the ⭐ top pull request Top pull request. label Jun 18, 2025
@pomianowski pomianowski merged commit 7f0dd18 into lepoco:main Jun 18, 2025
2 checks passed
@jbryknar jbryknar deleted the feature/1250-Fix_paste_issue_with_PasswordBox_and_asterisk branch June 18, 2025 16:00
@Nuklon
Copy link
Contributor

Nuklon commented Oct 17, 2025

This logic is completely broken, I'll create a new PR to address it.

@Nuklon
Copy link
Contributor

Nuklon commented Oct 17, 2025

#1547

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 ⭐ top pull request Top pull request. styles Topic is related to styles

Projects

None yet

3 participants