AutoComplete forceSelection with Multiple overwrites selection #1205
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
[ x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110
Current behavior
The following happens if you have forceSelection on an AutoComplete that has :multiple="true".
Issue 1
Actions: Select 1 item and then start typing to select another item, but do not select from dropdown.
Result: The initially selected item is cleared.
Issue 2
Actions: Select 1 item and then select another
Result: The first item is cleared out/replaced by the second one that was selected
Expected behavior
Issue 1
Expected: The item that is already selected remains, but the characters that were typed are cleared
Issue 2
Expected: Both of the selected items are in the input field
Minimal reproduction of the problem with instructions
This bug can be reproduced by adding the forceSelection property to the Multiple AutoComplete of the PrimeVue Demo
<AutoComplete :multiple="true" v-model="selectedCountries" :suggestions="filteredCountries" @complete="searchCountry($event)" field="name" forceSelection/>
What is the motivation / use case for changing the behavior?
We would like to be able to force the user to make a selection from the items returned by the AutoComplete while at the same time being able to use the Multiple functionality
Please tell us about your environment:
OS: Windows 10, Windows Server 2012
IDE: VS Code
HTTP Server: Vue-CLI dev server
Vue version: 3.0.11
PrimeVue version: 3.4.0
Browser: Chrome 89
The text was updated successfully, but these errors were encountered: