A labelled dropdown row: label left, value box right. Clicking the box opens a scrollable
popup list on UIRoot.popupLayer behind a click-blocking backdrop, so nothing underneath can
be interacted with while it is open (Escape or an outside click closes it). display entries
override row labels while items holds the raw values delivered to onSelect.
Set searchable for combo-box type-ahead: while the popup is open, typing filters the list
(case-insensitive substring on the shown labels), Backspace edits the query, and Enter picks
the first match. A search header at the top of the popup shows the query.
Constructor
new(label:String, width:Float, ?onSelect:(index:Int, value:String) ‑> Void)
Parameters:
label | the row text on the left |
|---|---|
width | layout width (the value box sits at the right edge) |
onSelect | fired when the user picks an entry |
Variables
searchable:Bool = false
Combo-box type-ahead: while open, typing filters the popup and Enter picks the first match.
Methods
localize(key:String, fallback:String):Void
Switches the label to a localized string.
Parameters:
key | the translation key |
|---|---|
fallback | the source-language text |
select(index:Int):Void
Programmatically selects an index without firing onSelect.
Parameters:
index | the entry to select (ignored when out of range) |
|---|
setItems(items:Array<String>, ?display:Array<String>):Void
Sets the entries, keeping the selection when possible.
Parameters:
items | the raw values delivered to |
|---|---|
display | optional per-entry labels shown instead of the raw values |