-
Notifications
You must be signed in to change notification settings - Fork 882
feat(InputMenu): add allowFreeInput
prop to behave like a real input
#4942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Conversation
Add `allowFreeInput` prop to InputMenu component. This prop enables users to type any value in the input field, even if it is not present in the items list. When enabled, the typed value is directly reflected in `v-model`, making the InputMenu behave more like a standard input field rather than a strict select. - Added `allowFreeInput?: boolean` prop (default: false) - Updated ComboboxInput to emit `update:modelValue` when free input is allowed - Maintains backward compatibility for users who do not enable this prop Closes nuxt#4859
…le to parameter of type '"remove-tag"'.
commit: |
Sorry, it's my first pull request. I realize that just making tweaks isn't the right approach, and I’m not fully sure how to proceed cleanly. |
I've tried to contribute, but I wasn't able to create a clean pull request, so I'm losing my changes. That said, I still feel that InputMenu does not behave like a true input but more like a SelectMenu. I don't understand why InputMenu and SelectMenu are so similar. From my perspective, InputMenu should act as an autocomplete, where the user's input is the priority, and shouldn't be cleared on blur. Here's an example of what I imagine InputMenu should be (a true autocomplete, and not a select menu): @benjamincanac I'd love to hear your thoughts on this and whether you agree with this approach or see it differently. |
@maximelebreton The InputMenu component is built on top of Reka UI's Combobox component: https://reka-ui.com/docs/components/combobox Do you manage to achieve your expected behavior with it? 🤔 |
3f0c24a
to
c9ba808
Compare
Unfinished Pull Request – Need Guidance / Help :)
Add
allowFreeInput
prop to InputMenu component.This prop enables users to type any value in the input field, even if it is not present in the items list. When enabled, the typed value is directly reflected in
v-model
, making the InputMenu behave more like a standard input field rather than a strict select.🔗 Linked issue
Resolves #4859
❓ Type of change
📚 Description
allowFreeInput?: boolean
prop (default: false)update:modelValue
when free input is allowedPreviously, it was not possible to have an autocomplete behavior
where suggestions appear but the typed value always takes priority.
The input acted like a SelectMenu, requiring the value to exist
in the items list.
With
allowFreeInput
, the user can type any value, which isdirectly reflected in
v-model
, while still showing suggestionsfrom the items list.
📝 Checklist