Repository navigation
fix(fields): tags, lookup and people pickers leave an IME-owned Enter to the input method - #35993
Conversation
… to the input method TagsField (Enter and comma) and the search boxes of LookupField and PeoplePicker now ignore a key pressed while an input method composes, and Safari's keyCode 229 Enter raised after compositionend, through one package-internal isImeKey predicate. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
|
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv Final green head · 2026-11-21T05:19Z · area b1-DB
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — ACCEPT (L1-b)Head-sha: cf02f7c · read 2026-11-21T05:21Z 维护者速读
Must-fixNone. Should-fix
Checked
Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T05:22Z · Area b1-DB's PR for #35797: Tags (Enter and comma), Lookup and People search boxes ignore a key the input method is using ( |
Requested by Sales · project thread
Fixes #35797
Clause-②: no
Metadata-protocol: none
Skills-docs: none — a keyboard bug fix inside three field widgets; no metadata key, value or authoring guidance moves
维护者速读
What changes
TagsField(Enter and comma), and the search boxes ofLookupFieldandPeoplePicker(Enter picks the highlighted entry, the arrows move it), now return early on a key the input method owns: one pressed while a composition is open (isComposing, keyCode 229), or the Enter Safari raises just aftercompositionendwith keyCode 229. The next Enter (or comma) does what it always did.isImeKeyin a new package-internal module,ui/packages/fields/src/widgets/imeKey.ts. Nothing re-exports it from the@object-ui/fieldsentry (measured below).isImeKey. The grid's predicate lives in@object-ui/componentsatrenderers/complex/dataTableCellSelection.tsand is not on that package's entry: its exports map is.and./style.css, and the entry does not re-export the module.@object-ui/fieldscan only reach it if@object-ui/componentsadds a new export to its published entry, which isClause-②: yes (widening). No lower package that both import (@object-ui/core,@object-ui/react,@object-ui/types) carries a keyboard helper or a subpath that could hold one without the same widening. So the fields copy is a second definition of the same one-line predicate, said in its doc comment; nothing checks that the two still agree. The seat ruled (card Field widgets: Tags, Lookup and People act on an Enter pressed while an input method is composing #35797 comment 7057636936) that the card's "one shared helper" means one predicate inside@object-ui/fields; collapsing it with the grid's copy is follow-up Field widgets: Grid, DatePicker and RecordPicker act on an Enter pressed while an input method is composing; one IME-key predicate for grid and fields #35996.Inputfrom@object-ui/componentswith the widget's ownonKeyDown; no combobox or command primitive owns the Enter. The fix reaches exactly these three widgets, wherever they are mounted: the record form, the list grid's cell editors, and the action parameter dialog.Tests
ui/packages/fields/src/widgets/imeComposition-35797.test.tsx(new): for each widget, a Chromium/Firefox sequence (compositionstart, keydown Enter withisComposing: trueand keyCode 229,compositionend) and Safari's sequence (compositionstart,compositionend, keydown Enter keyCode 229 withisComposingfalse). Each case ends with the control: a plain Enter (keyCode 13) adds the tag or takes the row, so a guard that swallowed every Enter goes red too. Plus TagsField's comma, PeoplePicker's arrow key inside a composition, and the predicate's truth table.Pin run and per-widget ablation
Pins at the fix:
Test Files 1 passed (1),Tests 10 passed (10).Ablation, one widget at a time, through
scripts/ablation-replace.mjs(anchorif (isImeKey(e)) return;hit once and replaced, blob moved, restored blob equals HEAD,git diff HEADempty after each). The test imports the widgets fromsrcby relative path, so no build sits between the mutation and the run.TagsFieldLookupFieldPeoplePickerEach ablation reds only its own widget's cases.
Chromium with a real composition (CDP)
A scratch page bundled the three widgets from this branch's
srcand ran in Chromium 1243 (Playwright 1.63, headless). Composition was driven with CDPInput.imeSetComposition, the candidate-picking key withInput.dispatchKeyEvent(virtual key 229), and the commit withInput.insertText.isComposingwas not set by the script: Chromium reportedisComposing: trueon its own, from the open composition. The log readcompositionstart, keydown Enter 229isComposing: true,compositionendin all three widgets.false(control)ni, then commitniadded (the half-typed pinyin)Mar, IME Enter after the answerr2taken, list closedr2takenu1selectedu1selectedSafari: NOT MEASURED in a browser. No WebKit build is installed in this container (only
/opt/pw-browsers/chromium*), and the container rule forbidsplaywright install. Safari's post-composition 229 Enter is pinned in jsdom as above.Acceptance notes
GridField's cellonKeyDown(Enter moves to the next row),DatePickerField's typed-text Enter commit, andRecordPickerDialog's page-jump Enter read Enter with no composition guard. Per the seat's ruling (card Field widgets: Tags, Lookup and People act on an Enter pressed while an input method is composing #35797 comment 7057636936) they move to follow-up Field widgets: Grid, DatePicker and RecordPicker act on an Enter pressed while an input method is composing; one IME-key predicate for grid and fields #35996 (Blocked-by this PR).isImeKeyin@object-ui/componentsand the fields module are byte-identical today; nothing checks that they stay so. Collapsing them to one needs either a new export on the components entry (Clause-②: yes (widening)) or a home in a lower package; per the seat's ruling (card Field widgets: Tags, Lookup and People act on an Enter pressed while an input method is composing #35797 comment 7057636936) that is follow-up Field widgets: Grid, DatePicker and RecordPicker act on an Enter pressed while an input method is composing; one IME-key predicate for grid and fields #35996.Verification
Read first:
ui/packages/fields/src/widgets/imeKey.ts(the predicate and why it is a second copy), then the guard line inPeoplePicker.tsxandLookupField.tsx, whose handlers also own the arrow keys.Two-minute check:
pnpm --dir ui exec vitest run packages/fields/src/widgets/imeComposition-35797.test.tsx. ExpectTests 10 passed (10).Local gates and package runs
All at head
cf02f7c1, onobjectstack-ai/objectstack.pnpm --workspace-concurrency=2 --filter '@object-ui/fields^...' build,VERDICT command-exit 0.pnpm --filter @object-ui/fields type-check(bothtsc --noEmitandtsc -p tsconfig.test.json;--listFilesOnlyshows the new test in the test program andimeKey.tsin the source program): exit 0.pnpm --filter @object-ui/fields build: exit 0. No new entry export:isImeKeyappears 0 times indist/index.d.ts(control:TagsFieldappears 2 times there). The module's owndist/widgets/imeKey.d.tsis a per-file declaration like the 104 other widget declarations, and the exports map reaches only.and./style.css.pnpm --dir ui exec vitest run packages/fields/:Test Files 309 passed | 1 skipped (310),Tests 4700 passed | 7 skipped (4707).node scripts/pm/dispatch-gates.mjs --commands: 38 families derived; all 38 run, exit 0 each.--ranreconciliation:38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero).eslinton the five touched source files: 0 errors; the 80 warnings are all on lines this diff does not touch inLookupField.tsxandPeoplePicker.tsx, and the two new files have none.pnpm check:new-line-citations(ui):0 new citation(s).node scripts/pm/overlap-check.mjs --branch=HEAD:origin/main: merges cleanly,VERDICT clean exit 0.Lint UI,Type Check UI,Test UI,Build & E2E UI,Live E2E UIand the repo-wide lanes. The five type-check program steps and the CI-measured-only families thatdispatch-gatesnames are NOT MEASURED locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv