Files
multica/packages
Naiyuan Qing 3d36c715e4 fix(pickers): keep the empty row out of the search Enter default
Pinning the empty value first also made it the first `data-picker-item`.
PropertyPicker reset the highlight to index 0 on every keystroke and Enter
commits the highlighted row, so typing a query and pressing Enter cleared
the field instead of selecting the match the user was looking at —
"mobile" + Enter detached the project; a member's name + Enter unassigned
the issue.

A second path had the same end: the empty row survives every filter, so a
query with no matches left it as the sole item and the single-result
auto-select fired on it.

Mark the row instead of hiding it. `PickerItem` takes `emptyValue`, which
stamps `data-picker-empty`, and PropertyPicker:

- resolves the post-keystroke highlight to the first row without that
  attribute (-1 when nothing else matched, leaving Enter inert), and
- refuses to auto-select a lone empty row.

The index can't be computed in the input's onChange — the filtered list
hasn't rendered yet — so the keystroke raises a ref flag that an effect
resolves against the fresh DOM. Guarding on the flag is what keeps arrow
keys able to walk back onto the empty row: only typing moves the
highlight off it.

Marked on rows that write null/undefined (project, assignee, stage,
custom property), not on issue priority's "none", which is a real enum
member rather than a cleared field.

Regression tests cover Enter-on-match, Enter-on-no-match, and
arrow-key reachability for project, plus the first two for assignee
(which had no test file). All five fail without this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 16:08:14 +08:00
..