[UInputMenu] clearing `search-term` does not update the input element
Environment
| Operating system | Windows 10.0.26200 |
| CPU | AMD Ryzen 5 5600X 6-Core Processor (12 cores) |
| Node.js version | v26.1.0 |
| nuxt/cli version | 3.35.2 |
| Package manager | [email protected] |
| Nuxt version | 4.4.6 |
| Nitro version | 2.13.4 |
| Builder | [email protected] |
| Config | app, compatibilityDate, css, devtools, eslint, experimental, i18n, icon, modules, runtimeConfig, scripts, ssr |
| Modules | @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @pinia/[email protected], pinia-plugin-persistedstate/[email protected], @vueuse/[email protected], motion-v/[email protected], @nuxtjs/[email protected] |
Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
v4.7.1
Reproduction
https://codesandbox.io/p/sandbox/admiring-scooby-xxgk9h
Description
Write something to input, and then try clearing it with the button. It sets the modelValue to '' but the input box is not cleared.
Additional context
No response
Logs
Oh, also, even if I use the clear prop, the icon of that does not appear.
I opened #7341 to fix this. Unlike #6494, it also covers single mode: searchTerm updates from the parent (e.g. clearing it) are now forwarded to the input, while the selected item label is still kept when the component resets searchTerm itself after selecting an item or closing the menu. Tests cover both single and multiple mode.
About the clear icon: it clears the selected value (modelValue), so it only shows up once an item is selected, not while you're just typing. I left that as is since it looks intentional, but I'm happy to change it if you'd rather have it clear the search term too.