fix(SelectMenu/InputDate/InputTime/InputMenu): three upstream component fixes (nuxt/ui@aab2d10, nuxt/ui@8e4546e, nuxt/ui@b3d4342) - #609
Open
IgorShevchik wants to merge 1 commit into
Open
IgorShevchik wants to merge 1 commit into
IgorShevchik wants to merge 1 commit into
Conversation
…nt fixes (nuxt/ui@aab2d10, nuxt/ui@8e4546e, nuxt/ui@b3d4342) Three contiguous upstream commits in one PR, per §6 step 4b. Different components, non-overlapping tests, so a failure still names the one that broke. SelectMenu — reka's `ComboboxTrigger` hard-codes `aria-label="Show popup"`, which beats every other naming mechanism, so a screen reader announced it instead of the `B24FormField` label. Measurably present: 53 occurrences in each of the two snapshot files. Fixed with `'aria-label': undefined` placed BEFORE the spreads, so a caller-supplied label still wins — it clears a default rather than blocking the prop, which is what upstream's second test pins. 106 snapshots updated, and every pair was compared rather than accepted: 106 of 106 differ only by the removed attribute, 0 differ by anything else, and the string is now absent from both files. InputDate/InputTime — a date field is several focusable segments, and `@blur` / `@focus` fire on each, so moving from day to month emitted blur+focus and a form validating on blur ran mid-entry. Now `@focusout`/`@focusin`, which bubble, with a guard ignoring movement inside the field. `test/utils/form.ts` registers `B24InputDate` and `B24InputTime` so `renderForm` can mount them. Each half is pinned by a different test: dropping the guard fails the "between segments" pair, reverting the listeners fails "focus and blur events" and "validate on blur works". InputMenu — in `multiple` mode `TagsInputInput` adds the search term as a tag on Enter, but `TagsInputRoot` is driven by the combobox, so the tag never reaches `modelValue` and renders a chip that is not selected. That last one needed more than a faithful port. Upstream's two tests both pin real behaviour, but removing the `isComposing || !searchTerm` guard left all 166 tests green — upstream's included. A line nothing checks is a line a later cleanup deletes with a green suite, so the `!searchTerm` half is now pinned by a test that is red without the guard and green with it: with nothing typed there is no tag to add, and preventing the key would also swallow the implicit form submission an empty field allows. `event.isComposing` is left uncovered, and the failed attempt is recorded rather than papered over. A probe building `new KeyboardEvent('keydown', { isComposing: true })` reads the flag back as true, but the event is reported prevented anyway — `defaultPrevented` there is influenced by other handlers on the same key, so the probe cannot attribute the outcome to this guard, and a test asserting on it would pass for a reason unrelated to the line it claims to cover. What the flag is for: during IME composition Enter confirms the candidate character, and swallowing it would break text entry for Chinese, Japanese and Korean users. Also reconciles the `a3c3ff34` and `60db60e0` entries with #608 / 0fe8ece. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports three contiguous upstream fixes in one PR, per
.sync/PORTING.md§6 step 4b — different components with non-overlapping tests, so a failure still names the one that broke.aab2d10d—fix(SelectMenu): remove the inherited "Show popup" aria-label· journal8e4546e3—fix(InputDate/InputTime): emit focus and blur when focus enters or leaves the field· journalb3d4342d—fix(InputMenu): prevent tags input from adding the search term on enter· journalSelectMenu — an accessible name that was being shadowed
reka's
ComboboxTriggerhard-codesaria-label="Show popup", and anaria-labelbeats every other naming mechanism — so a screen reader announced "Show popup"
instead of the
B24FormFieldlabel, on every SelectMenu in the library.Measurably present here: 53 occurrences in each of the two snapshot files.
undefinedgoes before the spreads so a caller-supplied label still wins — itclears a default rather than blocking the prop, which is exactly what upstream's
second test pins.
106 snapshots updated, and every pair compared rather than accepted —
test:updaterewrites the whole suite, which is how an unrelated drift getsabsorbed:
aria-label="Show popup"now appears 0 times in either file.InputDate / InputTime — blur fired between segments
A date field is several focusable segments.
@blurand@focusfire on each,so moving from day to month emitted blur+focus and a form validating on blur ran
mid-entry, against a value the user had not finished typing.
Now
@focusout/@focusin— which bubble — with a guard that ignores movementinside the field.
test/utils/form.tsregistersB24InputDateandB24InputTimeso
renderFormcan mount them.Each half pinned by a different test:
…not between segments,validate on blur ignores focus moving between segments@blur/@focusfocus and blur events…,validate on blur worksInputMenu — and the part that needed more than a faithful port
In
multiplemodeTagsInputInputadds the search term as a tag on Enter, butTagsInputRootis driven by the combobox — the tag never reachesmodelValue, sothe user sees a chip that is not selected and cannot be acted on.
Upstream's two tests both pin real behaviour (no stray chip; a highlighted item is
still selected, so the fix does not over-block). But:
A line nothing checks is a line a later cleanup deletes with a green suite. The
!searchTermhalf is now pinned by a test that is red without the guard and greenwith it, and is the only test that moves: with nothing typed there is no tag to
add, and preventing the key would also swallow the implicit form submission an
empty field allows.
event.isComposingis left uncovered, and the failed attempt is recorded ratherthan papered over. A probe building
new KeyboardEvent('keydown', { isComposing: true })reads the flag back astrue, but the event is reported prevented anyway—
defaultPreventedthere is influenced by other handlers on the same key, so theprobe cannot attribute the outcome to this guard. A test asserting on it would
pass for a reason unrelated to the line it claims to cover. What the flag is for:
during IME composition Enter confirms the candidate character, and swallowing it
would break text entry for Chinese, Japanese and Korean users.
One subtlety carried over
The InputDate/InputTime tests reset the fake clock before dispatching, with an
afterEachrestoring it:Without it the dispatched events are silently ignored and the tests pass for the
wrong reason. Worth knowing before anyone simplifies the clock handling out.
Gate
dev:prepare·lint·typecheck·build·test:coverage(355 files,8103 passed — 24 more than before, the new tests across both environments) ·
test:module— green.Cursor advances
60db60e0→aab2d10d→8e4546e3→b3d4342d, which isupstream
v4's current HEAD; thea3c3ff34/60db60e0entries are reconciledwith #608 /
0fe8ece3. A closing bookkeeping PR follows.🤖 Generated with Claude Code
https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
Generated by Claude Code