Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clearOnBlur does not work when blurring from focused autocomplete item #994

Open
tszewcow opened this issue Jun 1, 2021 · 1 comment
Open

Comments

@tszewcow
Copy link

tszewcow commented Jun 1, 2021

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 tszewcow changed the title clearOnBlur does not work when bluring from focused autocomplete item clearOnBlur does not work when blurring from focused autocomplete item Jun 1, 2021
@tszewcow
Copy link
Author

tszewcow commented Jun 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant