Skip to content

fix: TextBox, NumberBox, PasswordBox Placeholder Not Working Properly.#1109

Merged
pomianowski merged 1 commit intolepoco:developmentfrom
textGamex:fix-bug
Jun 4, 2024
Merged

fix: TextBox, NumberBox, PasswordBox Placeholder Not Working Properly.#1109
pomianowski merged 1 commit intolepoco:developmentfrom
textGamex:fix-bug

Conversation

@textGamex
Copy link
Copy Markdown
Contributor

@textGamex textGamex commented Jun 4, 2024

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 Password is set before setting PlaceholderEnabled, both PlaceholderText and Password will appear simultaneously.
  • If PlaceholderEnabled is false and PlaceholderText is not empty, clearing Text will still display PlaceholderText.

Issue Number: #1043

What is the new behavior?

  • fix this bugs.
  • If PlaceholderEnabled is set to false and PlaceholderText is not empty, clearing Text will not display PlaceholderText.

Other information

Added a new dependency property CurrentPlaceholderEnabledProperty.

@textGamex textGamex requested a review from pomianowski as a code owner June 4, 2024 06:38
@github-actions github-actions Bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request dotnet labels Jun 4, 2024
@textGamex

This comment was marked as resolved.

@pomianowski pomianowski merged commit 00a4c0c into lepoco:development Jun 4, 2024
@textGamex textGamex deleted the fix-bug branch June 5, 2024 02:42
@textGamex
Copy link
Copy Markdown
Contributor Author

In fact, when we set PlaceholderEnabled from false to true, if Text is empty, the PlaceholderText will not be displayed immediately. It will only be shown after the OnTextChanged event is triggered. A solution would be to add an OnPlaceholderEnabledChanged event, which calls the SetPlaceholderTextVisibility method when PlaceholderEnabled is set from false to true.

I'm not sure if there is a better solution, or should we put this issue on hold for now, what do you think? @pomianowski

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants