primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.58k stars 1.23k forks source link

AutoComplete: the forceSelection property causes inconsistent behavior when the value is removed #3525

Open alexandrapopa96 opened 1 year ago

alexandrapopa96 commented 1 year ago

Describe the bug

The forceSelection property setted on true causes inconsistent behavior when the value is removed. If you already had a value in the input and you want to remove it and to type directly another one (without clicking outside the input after clearing it), the value will no longer have the correct format. That will work correctly only if you click outside the input after clearing it.

Reproducer

https://codesandbox.io/s/pedantic-smoke-75tr44?file=/src/AutoCompleteDemo.vue

PrimeVue version

3.21.0

Vue version

3.x

Language

ES6

Build / Runtime

Vue CLI App

Browser(s)

Chrome

Steps to reproduce the behavior

Step 1. Type a full country name (ex: 'Italy'), and click outside the input, without selecting anything from the list

Step 2. Remove all the text from the input and then continue with step 1

Step 3. Remove again all the text, CLICK OUTSIDE the input and then continue with step 1

Expected behavior

No response

alexandrapopa96 commented 1 year ago

https://user-images.githubusercontent.com/53433973/211941295-dae64473-8fe9-4c5e-80b2-5c38990fc6ea.mp4

I have attached a video with a short demo, to be clearer