AvaloniaUI / avalonia-docs

https://docs.avaloniaui.net/docs/welcome
64 stars 213 forks source link

ComboBox doesn't support multiple selection mode as stated in the docs #505

Closed LazaroOnline closed 5 months ago

LazaroOnline commented 5 months ago

Describe the bug

According to the ComboBox documentation the multi-selection should be possible: https://docs.avaloniaui.net/docs/reference/controls/combobox

There is a "SelectedItems" property described as: A collection of selected items that has more than one item when selection mode is set to multiple.

This references another property: "SelectionMode", but both properties are inherited from the base class SelectingItemsControl with the comment:

properties are protected, however a derived class can expose these if it wishes to support multiple selection.

But ComboBox class doesn't expose those properties publicly.

Also the API reference shows these properties.
However the API reference doc lists all properties even if they are not public, without mentioning the accessibility of the properties listed, making it confusing for people trying to use the control.

To Reproduce

If you try to use a ComboBox with those properties, you get an execution error due to the property not being accessible:

<ComboBox SelectedItems="{Binding MyItems}" SelectionMode="Multiple" />

Expected behavior

ComboBox should support multi-selection exposing the properties SelectedItems and SelectionMode.

Also as a side note, it would help if the API reference doc either included only the public properties or shows the accessibility level of each property.

Avalonia version

11.0.10

timunie commented 5 months ago

@LazaroOnline yeah this is wrong in the docs. Could you provide a PR to fix the docs?

LazaroOnline commented 5 months ago

A multi-selection combo-box would be in my top 3 of the most wanted upcoming features. If this was a bug then lets make this a [Feature-Request] in this other issue I will create a PR in the docs to remove that part until it is finally implemented.