comboboxavaloniaui

Avalonia UI - ComboBox not working a t runtime


I have a ComboBox definition in my project which "works perfectly well" in the design view. Meaning that on click, the various ComboBoxItems can be seen and selected. However, I do not have this behavior at runtime. It just shows the ComboBox and nothing happens when clicked. No dropdown, no ComboBoxItem.

I tried to remove all the styling and as a test case, use the ComboBox example from Avalonia Docu. I still have the same issue. What could be the problem?

-- This is the example from Avalonia Docu which doesn't work also ---

<StackPanel Margin="20">
  <ComboBox SelectedIndex="0" MaxDropDownHeight="100">
    <ComboBoxItem>Text Item 1</ComboBoxItem>
    <ComboBoxItem>Text Item 2</ComboBoxItem>
    <ComboBoxItem>Text Item 3</ComboBoxItem>
    <ComboBoxItem>Text Item 4</ComboBoxItem>
    <ComboBoxItem>Text Item 5</ComboBoxItem>
    <ComboBoxItem>Text Item 6</ComboBoxItem>
    <ComboBoxItem>Text Item 7</ComboBoxItem>
    <ComboBoxItem>Text Item 8</ComboBoxItem>
    <ComboBoxItem>Text Item 9</ComboBoxItem>
  </ComboBox>
</StackPanel>

Solution

  • I had exactly same issue and it is somehow connected with Rider on macOS. When I run app with full screen Rider, the app doesn't popup on desktop but inside fullscreen Rider. In this mode I was not able to use ComboBox. But when I'm not using Rider in full screen but on Desktop, the ComboBox works!

    I also found "hack" when you want to use Rider in full screen: Run the app, the app will popup in fullscreen Rider and now press mouse button on top header frame of app and also press control + left key => you will bring application to left desktop and now ComboBox also works!