microsoft / microsoft/microsoft-ui-xaml
The IsDropDownOpen property is not working in the WinUI ComboBox
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
When the IsDropDownOpen property is set to true in the ComboBox as shown below, the drop-down does not open when the application is launched.
```
```
But when switching the IsDropDownOpen state at runtime, it works fine in that case. Also, when using the Loaded event and a dispatcher to set IsDropDownOpen to true as shown below, it works fine. Is this the expected behavior? It doesn’t work directly when we set the property to true in the Control.
```
private void MyComboBox_Loaded(object sender, RoutedEventArgs e)
{
this.DispatcherQueue.TryEnqueue(() =>
{
MyComboBox.IsDropDownOpen = true;
});
}
```
### Why is this important?
Our custom control is also facing the same issue.
### Steps to reproduce the bug
1. Add a ComboBox in WinUI.
2. Set IsDropDownOpen to true.
3. Launch the application.
Note: The DropDown does not open.
### Actual behavior
_No response_
### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
Windows App SDK 2.2.0
### Windows version
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing the provided ComboBox XAML and compare startup behavior with changing IsDropDownOpen from the Loaded handler through DispatcherQueue. Trace the ComboBox handling of IsDropDownOpen during initialization and add coverage showing that a value set in XAML opens the drop-down when the application launches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100