Combobox editor
cellEditor: 'combobox' is an editor where typing filters a list below the input and you pick an item as the value. It suits long lists that are hard to scan in a select. The default select is unchanged.
{ id: 'city', editable: true, cellEditor: 'combobox',
editorOptions: [{ value: 'SEL', label: 'Seoul' }, { value: 'BSN', label: 'Busan' }],
editorParams: { match: 'contains', pickSingleMatch: true } }It needs the optional editors bundle (maxgrid/editors in the modular build). Without the bundle, creating the grid fails with invalid-option. The list comes from the same sources as select: a fixed array, a per-row function, or optionsFrom. The item text is label, then optionLabel, then the value. An empty list keeps the editor closed.
Options
All go in editorParams. Defaults apply when omitted.
| Option | Value | Default | Effect |
|---|---|---|---|
match | 'contains' · 'startsWith' | 'contains' | How the typed text is searched in the item text; case is ignored |
pickSingleMatch | boolean | false | Enter picks the item automatically when exactly one item matches |
maxHeight | integer 80-600 (px) | 240 | Maximum list height; longer lists scroll inside |
itemAlign | 'start' · 'center' · 'end' | 'start' | Alignment of the item text |
renderItem | (option, { query }) => string | none | Text shown for an item; used as plain text, never parsed as HTML |
commitOnPick | boolean | true | Commit as soon as an item is picked; false only fills the input |
allowCustom | boolean | false | Accept text that is not in the list; text equal to an item gives its value |
noResultsText | string | per language | Text shown in the list when nothing matches |
Common input attributes such as placeholder and inputMode work as usual. An unknown key or a wrong value fails at creation with invalid-option (for example maxHeight: 50).
Keyboard
| Input | Action |
|---|---|
| Typing | Filters the list by the item text |
| ↓ · ↑ | Opens a closed list; moves the active item in an open list (stops at the ends) |
| Home · End | Jumps to the first or last item while the list is open |
| Enter | Picks and commits the active item; without one it tries pickSingleMatch, then an item equal to the text |
| Tab | Picks and commits the active item, then moves to the next cell |
| Esc | Closes an open list only; a second press cancels the edit |
Enter on text that is not in the list does not commit and shows "Pick an item from the list." (with allowCustom the text is the value). Leaving with Tab or by clicking away keeps the old value. Clearing the text and committing empties the value.
Accessibility and mobile
The input is role="combobox" with aria-expanded, aria-controls and aria-activedescendant; the list is role="listbox" and the items are role="option" with aria-selected. Focus stays in the input. The active item is marked by a left bar as well as by colour.
On a narrow screen (520px or less) or a low touch screen the list opens as a bottom sheet, the same rule as the date picker. Pressing the dark backdrop closes only the list and does not commit the edit. On touch screens items are at least 44px. When there is no room below, the list flips above the cell.
IME input
While a composition is running the list is not filtered; it is filtered when the composition ends. The Enter that ends a composition never picks an item.
Gallery example: edit-combobox-builtin
Gallery example: edit-combobox-match
Gallery example: edit-combobox-mobile
See also
- Cell editing: input rules, validation, start keys
- Editor options: per-row lists,
optionsFrom,optionLabel