Skip to content
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

Autocomplete: make vmodel be the selected option #872

Open
mlmoravek opened this issue Mar 28, 2024 · 1 comment
Open

Autocomplete: make vmodel be the selected option #872

mlmoravek opened this issue Mar 28, 2024 · 1 comment
Labels
breaking Breaking changes enhancement New feature or request

Comments

@mlmoravek
Copy link
Member

mlmoravek commented Mar 28, 2024

Description

The vmodel of the autocomplete component is not the selected option. The vmodel is the input value, which can be an option or a property, defined by the field prop, of an option. So the vmodel is a string because the input value is a string (I think the o-input does not work for number, even a number type is acceptable, but that is a topic for later).

Currently the selected option is only emitted by the select event, and doesn't have a two-way binding.
We should change that, to be the vmodel be the selected option.
This will be a breaking change.

@mlmoravek mlmoravek added enhancement New feature or request breaking Breaking changes labels Mar 28, 2024
@mlmoravek mlmoravek changed the title Autocomplete: vmodel be the selected option Autocomplete: make vmodel be the selected option Apr 1, 2024
@whiplashwebb
Copy link
Contributor

@mlmoravek this would be really handy, I've been thinking about something similar so I can control the selected item easier. However, i think we need two-way bindings on the query and the selected option, rather than replacing one with the other. This would make this a non-breaking enhancement which i think is a big plus. Please don't make me refactor all of my autocompletes lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking changes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants