Skip to content

feat(InputMenu)!: rename autocomplete prop to mode - #68

Merged
IgorShevchik merged 2 commits into
mainfrom
claude/issue-61-inputmenu-mode
Jun 5, 2026
Merged

feat(InputMenu)!: rename autocomplete prop to mode#68
IgorShevchik merged 2 commits into
mainfrom
claude/issue-61-inputmenu-mode

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Summary

Ports the one remaining API divergence from upstream: nuxt/ui v4.8.0 renamed InputMenu's autocomplete prop to mode. This applies the same change to b24ui.

  • autocomplete?: booleanmode?: 'combobox' | 'autocomplete' (default 'combobox').
  • The native HTML autocomplete attribute is no longer omitted from InputHTMLAttributes, so it can be forwarded to the input again (the whole reason upstream made the change).
  • Internally a small isAutocomplete = computed(() => props.mode === 'autocomplete') replaces the old boolean checks (script uses isAutocomplete.value, template uses isAutocomplete).

Faithfulness to upstream

Matches nuxt/ui v4 exactly: mode values 'combobox' | 'autocomplete', default combobox, isAutocomplete selects the reka-ui Autocomplete vs Combobox component, native attribute freed.

Changed files

  • src/runtime/components/InputMenu.vue — prop + internal refs + Omit list
  • docs/content/docs/2.components/input-menu.md — "Use the mode prop set to autocomplete…"
  • docs/app/components/content/examples/input-menu/InputMenuAutocompleteExample.vuemode="autocomplete"
  • test/components/InputMenu.spec.tsmode: 'autocomplete'

Validation (run locally)

  • eslint on changed files
  • vue-tsc --noEmit (types)
  • vitest run InputMenu152 passed, snapshots unchanged (the rename produces identical rendered output)

⚠️ Breaking change

InputMenu's autocomplete prop is renamed to mode. Consumers migrate :autocomplete="true"mode="autocomplete". The commit carries a BREAKING CHANGE: footer so it surfaces in the changelog.

Note: other autocomplete references in the codebase (Select, SelectMenu, Input, Editor, html.ts) are the native HTML attribute and were intentionally left untouched.

Closes #61

https://claude.ai/code/session_01Qz7EXMncvEGiCj4WbmYgJo


Generated by Claude Code

claude added 2 commits June 5, 2026 15:33
Aligns with nuxt/ui v4.8.0. The boolean `autocomplete` prop becomes
`mode?: 'combobox' | 'autocomplete'` (default `'combobox'`), which frees the
native HTML `autocomplete` attribute to be forwarded again.

- InputMenu: add `mode` prop + internal `isAutocomplete` computed; stop omitting
  the native `autocomplete` attribute from InputHTMLAttributes
- docs + autocomplete example use `mode="autocomplete"`
- tests use `mode: 'autocomplete'` (snapshots unchanged — render is identical)

Closes #61

BREAKING CHANGE: InputMenu's `autocomplete` prop is renamed to `mode`.
Migrate `:autocomplete="true"` to `mode="autocomplete"`.
…mplete

Review follow-ups for the autocomplete->mode port:
- Wrap the rootProps source in computed() so switching mode at runtime
  recomputes the forwarded props (matches nuxt/ui v4 upstream; b24ui
  useForwardProps already accepts a ref, as in NavigationMenu).
- Add a test asserting the freed native autocomplete attribute now reaches
  the <input>.
@IgorShevchik
IgorShevchik merged commit 081a979 into main Jun 5, 2026
1 check passed
@IgorShevchik
IgorShevchik deleted the claude/issue-61-inputmenu-mode branch June 5, 2026 16:53
IgorShevchik added a commit that referenced this pull request Jun 9, 2026
…render (#76)

Port of nuxt/ui efd7b8ec. Re-highlights the first CommandPalette item
after the debounced results re-render via watch(filteredGroups) +
nextTick -> rootRef.highlightFirstItem(). Applied 1:1 (framework-level,
no b24ui divergence).

Also starts per-port ledger maintenance: .sync/nuxt-ui.json cursor ->
efd7b8ec with processed backfilled for #68-#72, plus a .sync/log entry.

Upstream: efd7b8ecc9fdbc75077c3ee6076f94fa4fa753f1
IgorShevchik added a commit that referenced this pull request Aug 31, 2026
…#518)

The ledger's log convention starts one entry in, at `d50c121c`, so the four
commits before it — `2799fa6f`, `631f5dc5`, `6102a87b`, `007b136a` (#68-#72) —
had a `processed` entry and no `.sync/log/<sha>.md`. #515 deferred both these and
the guard that would have caught them, on the grounds that writing a rationale
months later is reconstruction rather than record.

The record turned out to still exist. Both commits are readable on both sides,
and three of the four fork commits carry contemporaneous reasoning in their own
messages, so each log is derived from `git show` on the upstream commit and on
ours, and says at the top that it was backfilled and from what.

Re-deriving them surfaced an omission nobody had recorded: `2799fa6f` added an
autocomplete-mode row to upstream's InputMenu playground, the port dropped it,
and neither playground has one today. It also made two ports legible that the
one-line summaries had flattened — `631f5dc5` must NOT copy upstream's prop list
verbatim, because ours omits `loadingIcon` on purpose, and `007b136a` had to move
a cap between slots rather than add one, which is why it is breaking here and is
not upstream.

The guard asserts the pairing in both directions plus a floor on file size: a
missing log is the obvious failure, an orphaned log is what a mistyped SHA in a
filename looks like, and an empty file satisfies pairing while documenting
nothing. Three mutations verified. The heading format is deliberately not
guarded — it varies across the 280 files, and a rule there would be invented
rather than enforced.
IgorShevchik added a commit that referenced this pull request Aug 31, 2026
…ssing (#520)

Upstream's `2799fa6f` — the commit that renamed InputMenu's `autocomplete`
boolean to `mode: 'combobox' | 'autocomplete'` — added a row exercising the new
mode to its own playground. The port (#68) dropped that line, and nothing has
added one since, so the mode has never been reachable by hand in either
playground. No snapshot covers it either: the render is identical and only the
prop spelling differs, which is why the port could report "snapshots unchanged"
and be right.

The row takes its own ref rather than reusing one above it. In autocomplete mode
`modelValue` is the input text, a string, where every other row on the page binds
a selected item — which is the point of the mode and the thing a person is there
to look at.

Found by backfilling that commit's `.sync/log/` entry in #518, which is also
where the omission is recorded; the log is updated to say the gap was closed here
rather than leave a claim that is no longer true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputMenu: rename autocomplete prop to mode to free up the native HTML attribute

2 participants