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

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

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

textGamex
Copy link
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
2 checks passed
@textGamex textGamex deleted the fix-bug branch June 5, 2024 02:42
@textGamex
Copy link
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

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 styles Topic is related to styles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants