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: Adjust combobox template for editable feature #1516

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

eriklimakc
Copy link
Contributor

@eriklimakc eriklimakc commented Jan 8, 2025

Closes #1518

Copy link

github-actions bot commented Jan 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1516.eastus2.azurestaticapps.net

Copy link

github-actions bot commented Jan 9, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1516.eastus2.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1516.eastus2.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1516.eastus2.azurestaticapps.net

@eriklimakc
Copy link
Contributor Author

To have it aligned in all platforms i had to use these padding values here.

Platform Padding
Windows 0,21,0,0
Android 0,22,0,0
Skia 0,23,0,0
WASM 0,24,0,0

I also tried wrapping both the TextBox (here) and the ScrollViewer (here) in a Border with a fixed height, but it still behaved differently on platforms.

Recording.2025-01-14.155308.mp4

This video is it running on Windows, but it's very similar on the other platforms.

cc @kazo0 @Xiaoy312

<Style x:Key="MaterialComboBoxStyle"
TargetType="ComboBox">
<Setter Property="Foreground" Value="{ThemeResource ComboBoxForeground}" />
<Setter Property="Background" Value="{ThemeResource ComboBoxBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ComboBoxBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ComboBoxBorderThickness}" />
<Setter Property="Padding" Value="{ThemeResource ComboBoxPadding}" />

<Setter Property="TextBoxStyle" Value="{StaticResource MaterialComboBoxTextBoxStyle}" />
Copy link
Contributor

@Xiaoy312 Xiaoy312 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just opening a thread here for the textbox on focus padding/alignment problem: #1516 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a glance, it seems that the presence of the caret is pushing the element.
Have you tried to have a fixed height on the textbox or its scrollviewer (in textbox template) and set them to align bottom?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing the Height on the TextBox doesn't make any difference. I'm trying now to set the ScrollViewer (in the textbox template) height to 35 and its VerticalAlignment to bottom (also set scrollviewer bckgd to green). I had to remove the Padding and it looks like:

Windows - looks good

Recording.2025-01-14.172151.mp4

Skia

Recording.2025-01-14.172040.mp4

@Xiaoy312 @kazo0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Material] Support Editable ComboBox
3 participants