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

How can I change the input value by clicking on an element outside the autocomplete component? #167

Open
morganealemany opened this issue Nov 22, 2023 · 0 comments

Comments

@morganealemany
Copy link

I'm using 2.4.1 version with Vue 2.6.14. I have an autocomplete form which works perfectly :
`
<autocomplete
ref="model"
required
:search="onSearchModel"
:get-result-value="getResultValue"
:defaultValue="modelName"
:autoSelect="true"
@submit="onSelect"
@keydown="keyPress"
>



  • {{ result.name }}



  • <input type="hidden" :name="'model_id'" v-model="modelSelected" required @input="$emit('input', $event.target.value)">

    `
    I have some models preview on the same page and I want to change the input value when I click on it.
    So if I want to search with the input I can but I can also select one model and I want the input to reflect this selection.

    I succeed in changing the modelSelected and modelName value by clicking on a model preview but the input value does'nt change. How can I do to change it without refresh the page of course?

    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

    No branches or pull requests

    1 participant