primeng icon indicating copy to clipboard operation
primeng copied to clipboard

ForceSelection should also update the value

Open Mysame opened this issue 9 years ago • 4 comments

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

Mysame avatar Sep 27 '17 13:09 Mysame

Same here. please advise.

MosheMoualem avatar Oct 10 '17 10:10 MosheMoualem

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 avatar Oct 19 '17 10:10 reinpeter

@reinpeter That is fixed today -> #4263

cagataycivici avatar Oct 25 '17 11:10 cagataycivici

@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

Mysame avatar Nov 08 '17 16:11 Mysame