question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CheckBox has fixed Height/MinWidth in Template

See original GitHub issue

Describe the bug CheckBox has odd sizing due to fixed values in template (Height, MinWidth, etc…), this means if you just want to use the ‘check box’ without text as part of another layout/setup then it’s difficult to just drop-in place.

I’d expect if I had just a <CheckBox/> element for it’s bounding box to just be around the check like so:

image

(Or maybe with some Padding, but the Padding property is ignored by the check and only effects the inner Content.)

But it’s not and currently does this:

image

Version Info

NuGet package version: 2.4.2

Windows 10 version Saw the problem?
Insider Build (19041) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Mobile
Xbox
Surface Hub
IoT

Additional context

Fixed values in template:

https://github.com/microsoft/microsoft-ui-xaml/blob/6e99a4150772813f9f2303de162e5698164197dc/dev/CheckBox/CheckBox_themeresources.xaml#L293-L294

https://github.com/microsoft/microsoft-ui-xaml/blob/6e99a4150772813f9f2303de162e5698164197dc/dev/CheckBox/CheckBox_themeresources.xaml#L639-L659

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
StephenLPeterscommented, Jun 30, 2020

@michael-hawker Does setting the minheight/width not resolve your issue? I guess I’m a little confused. Also is it true that button doesn’t have a min size? I was pretty sure it did for the same reasons. I guess it expands to fill that space where Checkbox does not.

1reaction
mdtaukcommented, Jun 30, 2020

Hopefully with WinUI 3 we can find a more robust solution for CheckBox and RadioButton. Since those controls are not aware of the line height, essentially the padding for the tick/radio control needs to be hardcoded to correctly align with the text.

See #1520 for more on this.

Hopefully WinUI 3 will allow changes to the text controls to introduce Baseline alignment options, as well as x-height and other typographic metric alignment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Set the Checkbox Size with HTML and CSS
You can set the checkbox size by using the CSS width and height properties. Use the height property to set the height of...
Read more >
How to set checkbox size in HTML/CSS?
Method 1: The checkbox size can be set by using height and width property. The height property sets the height of checkbox and...
Read more >
Checkbox (input) height and width changing for mobile ...
The checkbox is inside a col-2 which is getting narrower in width. Both height:100% and width:100% are relative to the size of the...
Read more >
Behaviour of CheckBox in hyperref package (heights differ)
So the checkboxes differ in their size. Of course all of them have fixed height. All Checkboxes who have text with "underlength" (?)...
Read more >
Survey Form - Problem with checkbox - HTML-CSS
Hi, I have two problems with the checkbox: 1- I can't pass this ... Setting width to 100% on all input elements is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found