benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.71k stars 143 forks source link

Fix for ContentSite misaligning PART_EditableTextBox when editing (ComboBox) #70

Closed LaughingLeader closed 4 years ago

LaughingLeader commented 4 years ago

Describe the bug When a ComboBox flips between IsEditable true/false, the editable textbox (PART_EditableTextBox) gets misaligned due to the width of the hidden ContentSite.

Collapsing ContentSite instead of hiding it fixes this issue.

To Reproduce Steps to reproduce the behavior:

  1. Initialize IsEditable to "False" on a ComboBox using the default AdonisUI style.
  2. While the app is running, set IsEditable to true while the ComboBox has a valid item name.
  3. The editable textbox is pushed to the right from the ContentSite's width.

Expected behavior PART_EditableTextBox should be in the same spot that ContentSite is, so the text is aligned when switching between IsEditable true/false.

Screenshots Example when using Visibility.Hidden:

When using Hidden for Visibility

Example when using Visibility.Collapsed (expected/desired behavior):

When using Collapsed for Visibility

benruehl commented 4 years ago

Seems to work fine, thanks!