Autocomplete: ↓ moves into the list (no pre-selection)
Autocomplete: ↓ moves into the list (no pre-selection)
#5 in Riparion/riparion-editor — merged 2026-06-02
What
Refines the [[/ autocomplete keyboard model so the down arrow moves into the dropdown — letting you trigger, navigate, and insert without leaving the keyboard.
Before: the popup opened with item 0 pre-highlighted, so the first ↓ jumped to the second item (felt like it skipped the first). Now:
- Popup opens with nothing highlighted.
- First ↓ enters the list on the first item; first ↑ enters on the last; further ↓/↑ navigate (wrap). While open, arrows belong to the popup, not the textarea caret.
- Enter/Tab insert only once an item is selected; with nothing selected they fall through to the textarea (a normal newline/tab) — so you must ↓ first. After accept, the popup closes and arrow keys return to normal editing.
- Esc closes the menu with no insert and restores normal editing.
How
Autocomplete::selectedis nowOption<usize>(None= caret still in the text);selected()andCompletionPopup'sselectedprop change accordingly.on_inputopens/refilters withselected = None;on_keydownis None-aware for ↓/↑/Enter/Tab.
Verification
cargo test --no-default-features: 20 passed (purefind_trigger/apply_completionlogic unchanged).- clippy
-D warningson non-web--all-targetsand wasm--features web(incl. the example).
Consumed by riparion-cms via a pin bump.
🤖 Generated with Claude Code
Last updated 2026-06-03
Links to this note
Credits
Merged pull requests, newest first.