# TelamonComboBox

> A drop-down list with the current choice in a field and the choices in a raised card, optionally filterable.

TelamonComboBox shows the current choice in a field with a chevron, and the choices in a raised card like ContextMenu's. `model`, `textRole`, `currentIndex` and `activated` work as in any Qt Quick Controls `ComboBox`; see <https://doc.qt.io/qt-6/qml-qtquick-controls-combobox.html>. With `filterable: true`, the list opens with a filter field on top, which suits long lists.

## Example

```qml
TelamonComboBox {
    model: [qsTr("Light"), qsTr("Dark"), qsTr("Automatic")]
    currentIndex: 2
    onActivated: index => settings.theme = index
}
```

## Keyboard

In a filterable list, typing narrows the choices (any part of the text, in any case), Up and Down move among the ones left, and Return chooses. The filter clears when the list closes.

## Properties

| Name | Type | Default | Description |
|---|---|---|---|
| `filterable` | `bool` | `false` | Opens the list with a filter field at the top. |
| `placeholderText` | `string` | `""` | Shown while nothing is chosen (`currentIndex` is -1). |

> [!NOTE]
> A user edit keeps your binding. `currentIndex: model.x` stays bound: if your handler takes the edit it follows the model, and if it ignores it the value springs back after the handler. With a plain value or no binding the edit stays. `activated()` and `on<Property>Changed` see the edit at once, as before.
