Ngx-bootstrap: Error with onBlur in empty Typeahead

Created on 30 Mar 2020  Â·  10Comments  Â·  Source: valor-software/ngx-bootstrap

Hi,

my browser console points me to an error when I focus and unfocus a Typeahead input field without typing anything into it.

This is repoducable with all example inputs at the official docs page:
https://valor-software.com/ngx-bootstrap/#/typeahead

Repro steps:

  1. Open the console of your browser developer tools
  2. Set your cursor into the first example input to focus it
  3. (DO NOT type anything)
  4. Click anywhere else on the page to lose focus
  5. Have a look at the error in the console:
    In Chrome: image
    In Firefox: image

The error occures while trying to read the length of the undefined _matches array in the onBlur method of the typeaead: https://github.com/valor-software/ngx-bootstrap/blob/6047bcece88162e508f76e2b091d66badd682eca/src/typeahead/typeahead.directive.ts#L306

The same problem occurs with an asnyc typeahead when the user enters something into the input and blurs the input immediately without waiting for the results list.

Fortunately, the user does not see any error and the typeahead does not stop working at all. But console errors can be a problem in applidations when the client errors are sent to a backend.

Versions: (same as the offical docs at 2020/03/30)

ngx-bootstrap 5.6.0
bootstrap 4

Most helpful comment

Does anybody know when new package version will be available?

All 10 comments

same issue.

I am having the same issue.

I created a minimal stackblitz using the docs to reproduce the issue:
Stackblitz: https://stackblitz.com/edit/angular-hdod7r
Docs: https://valor-software.com/ngx-bootstrap/#/typeahead#async-data

Use the same steps as mentioned above to reproduce the issue.

Is there more news on this bug?

I'm facing the same issue. Is there any temporary workaround for this until the fix is merged?

Thanks @daniloff200

Does anybody know when new package version will be available?

Same issue, any update?

Any idea on when this will be fixed?

Should be available in 6.0.0, please, check

✓ It works for me with 6.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webdev48 picture webdev48  Â·  3Comments

mounthorse-slns picture mounthorse-slns  Â·  3Comments

phmello picture phmello  Â·  3Comments

srjkrl20011991 picture srjkrl20011991  Â·  3Comments

ghiscoding picture ghiscoding  Â·  3Comments