bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.79k stars 435 forks source link

🐛 Weird effect when a ComboBox is inside a SizedBox #1066

Open WinXaito opened 1 month ago

WinXaito commented 1 month ago

Describe the bug Put a ComboBox in a SizedBox, the content is based on the bigger element inside, instead of the real size of the combobox.

image

bdlukaa commented 1 month ago

Can you provide a reproducible snippet?

WinXaito commented 1 month ago
          SizedBox(
            width: 200,
            child: ComboBox(
              value: 1,
              items: const [
                ComboBoxItem(
                  value: 1,
                  child: Text('Val 1'),
                ),
                ComboBoxItem(
                  value: 2,
                  child: Text('Val 2'),
                ),
              ],
              onChanged: null,
            ),
          ),

Give this:

image

I would expect to have Val 1 on the left, and the chevron at the right.

Is it okay with that or you need a full reproductible project ?

Edit:

And if instead of 'Val 2' I put 'Val 2 long value', I got this when Val 1 is selected: image And that looks really weird.

itzhoujun commented 2 days ago

same issue