Skip to content

fix(InputMenu): sync search term with input value#6494

Open
Akur1a wants to merge 2 commits into
nuxt:v4from
Akur1a:fix/input-menu-search-clear
Open

fix(InputMenu): sync search term with input value#6494
Akur1a wants to merge 2 commits into
nuxt:v4from
Akur1a:fix/input-menu-search-clear

Conversation

@Akur1a
Copy link
Copy Markdown
Contributor

@Akur1a Akur1a commented May 25, 2026

🔗 Linked issue

Resolves #6473

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This keeps the InputMenu input bound to its searchTerm model in the single-value path, matching the existing multiple-value path. When a parent clears searchTerm, the rendered input value now clears as well instead of keeping stale text.

I also added a regression test for externally clearing searchTerm.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Validation:

  • node node_modules\eslint\bin\eslint.js src/runtime/components/InputMenu.vue test/components/InputMenu.spec.ts
  • node node_modules\vue-tsc\bin\vue-tsc.js --noEmit

@Akur1a Akur1a requested a review from benjamincanac as a code owner May 25, 2026 02:31
@github-actions github-actions Bot added the v4 #4488 label May 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37598ce7-9c59-427c-8344-7515829e2648

📥 Commits

Reviewing files that changed from the base of the PR and between 24f40ef and abdf9cb.

📒 Files selected for processing (2)
  • src/runtime/components/InputMenu.vue
  • test/components/InputMenu.spec.ts

📝 Walkthrough

Walkthrough

onInputUpdate now always assigns the incoming value into searchTerm. In the single-input rendering branch, Component.Input receives :model-value set to searchTerm only when mode is autocomplete. Tests import nextTick and add a case that mounts InputMenu in autocomplete mode, clears searchTerm to '', awaits re-render, and asserts the rendered input's value is ''.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(InputMenu): sync search term with input value' clearly and specifically describes the main change: ensuring the search term and input value stay synchronized, particularly for the single-input case.
Description check ✅ Passed The description is directly related to the changeset, explaining the bug fix for InputMenu not clearing the input when searchTerm is cleared externally, and mentions the added regression test.
Linked Issues check ✅ Passed The PR addresses issue #6473 by ensuring that clearing the search-term externally updates the input element's displayed value, which is the core coding requirement reported in the issue.
Out of Scope Changes check ✅ Passed All changes are within scope: the InputMenu.vue modifications fix the synchronization issue between searchTerm and input value, and the test additions provide regression coverage for the bug fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/runtime/components/InputMenu.vue

Parsing error: Unexpected token )

test/components/InputMenu.spec.ts

Parsing error: Unexpected token {


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Akur1a Akur1a force-pushed the fix/input-menu-search-clear branch from 24f40ef to abdf9cb Compare May 25, 2026 03:10
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 25, 2026

npm i https://pkg.pr.new/@nuxt/ui@6494

commit: 8bfd09a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UInputMenu] clearing search-term does not update the input element

2 participants