ForceSelection should also update the value
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/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports) http://plnkr.co/edit/n90yehxoCaSFaKuDoNZq?p=info
Current behavior
The fault lies in the following code: https://github.com/primefaces/primeng/blob/master/src/app/components/autocomplete/autocomplete.ts#L517
The string input of the AutoComplete is validated the the object.field in the suggestions list, but the ngModel value is never properly set. Because of this, the user must still click on a value in the drop-down, else the value bound to ngModel will be a string.
Expected behavior Set the ngModel value to the object in the suggestions corresponding to the string value
What is the motivation / use case for changing the behavior? Current implementation is wrong
Same here. please advise.
What i also see, is that the onblur verifies the forceSelection, and it uses the current suggestions list. But if the input field has already data (preloaded and valid), and if a user clicks in the input field, and clicks out of it before typing or hitting dropdown, the suggestion list is never set, and the input field is cleared.
@reinpeter That is fixed today -> #4263
@cagataycivici
The fix is partial. The control hijacks the mouse / keyboard. It's impossible to leave the control after selecting data.
https://plnkr.co/edit/P4L7eGEIYJNTwiYyDr4j?p=preview
Opened ticket at #4395