ngx-chips icon indicating copy to clipboard operation
ngx-chips copied to clipboard

clearOnBlur does not work when blurring from focused autocomplete item

Open tszewcow opened this issue 3 years ago • 1 comments

PLEASE MAKE SURE THAT:

  • you searched similar issues online (9/10 issues in this repo are solved by googling, so please...do it)
  • you provide an online demo I can see without having to replicate your environment
  • you help me by debugging your issue, and if you can't, do go on filling out this form

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior setting clearOnBlur does not remove input text for every scenario. See reproduction steps for details.

Expected behavior setting clearOnBlur to true should remove tag-input text everytime the control is blurred.

Minimal reproduction of the problem with instructions (if applicable)

  • set clearOnBlur to true
  • type something in tag input
  • blur input immediately / do not wait for dropdown to show autocomplete items -> input text is removed as expected -> OK
  • type something in tag input again
  • wait for dropdown to apear with some autocomplete items
  • blur the input without setting focus on autocomplete items -> input text ist removed as expected -> OK
  • type something in tag input again
  • wait for dropdown to apear with some autocomplete items
  • hover over one of the autocomplete items / put focus on it with keyboard (by pressing keydown)
  • do not select any item, just blur the control by mouse-left-clicking somewhere outside the control
  • item is not selected / dropdown is closed / input text remains in input but should be deleted - NOT OK

What do you use to build your app?. Please specify the version Angular CLI: 11.0.7

Angular version: Angular: 11.0.9

ngx-chips version: 2.2.2

Browser: Tested on Chrome 90

tszewcow avatar Jun 01 '21 13:06 tszewcow

Bug is simple to reproduce using the ngx-chips demo page, current master state (commit hash: a5a0cb4) Demo part: https://github.com/Gbuomprisco/ngx-chips/blob/master/demo/home/home.html#L68 Capture

tszewcow avatar Jun 08 '21 06:06 tszewcow