TextBox: Removed not needed VerticalAlignment and it now respects VerticalContentAlignment #3162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3161
Apparently I had missed this when doing the refactoring, and I must admit I cannot recall exactly why that
VerticalAlignmentwas introduced in theTextBoxstyle. My guess is one of two things happened:SmartHintto align correctly, orPasswordBoxandTextBoxstyles; becauseThe PasswordBoxhad this alignment already in its 2 styles.Anyways, this PR removes it as it does not seem needed. I think there may still be an issue though (should probably be created as a separate issue): I would assume that the hint as well as the "text box content" would respect theTextBox.VerticalContentAlignmentwhich I don't think it currently does.Another thing is, as mentioned in #3161, we should put some UI tests in place to catch regressions in these horizontal/vertical alignment scenarios.I managed to find a little free time after all. I updated the PR to consider
TextBox.VerticalContentAlignmentas well, and added UI tests for allVerticalAlignmentenum values. For the "non-top-aligned" scenarios, the user will need to manually adjust theHintAssist.FloatingOffsetto get correct floating placement of the hint (I have done this for the GIFs below).@Keboo The UI test is probably not the best test in the world, as it simply asserts the
VerticalAlignmentvalue is correctly propagated down to the hint. I guess ideally it should also assert that the absolute position of the hint is "correct" (i.e. top/center/bottom of theTextBox).VerticalAlignment.ToporVerticalAlignment.StretchVerticalAlignment.CenterVerticalAlignment.Bottom