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

Error with onBlur in empty Typeahead #5736

Closed
rgbweb opened this issue Mar 30, 2020 · 10 comments · Fixed by #5760
Closed

Error with onBlur in empty Typeahead #5736

rgbweb opened this issue Mar 30, 2020 · 10 comments · Fixed by #5760

Comments

@rgbweb
Copy link

rgbweb commented Mar 30, 2020

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:

if (!this.container && this._matches.length === 0) {

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
@boloboloda
Copy link

same issue.

@Theyssen
Copy link

Theyssen commented Apr 8, 2020

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.

emhaechi pushed a commit to emhaechi/ngx-bootstrap that referenced this issue Apr 12, 2020
Fix error thrown on blur before input is given

Closes valor-software#5736
@Theyssen
Copy link

Is there more news on this bug?

@ArturKwiatkowski
Copy link

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

daniloff200 pushed a commit that referenced this issue May 29, 2020
Fix error thrown on blur before input is given

Closes #5736
@rgbweb
Copy link
Author

rgbweb commented May 30, 2020

Thanks @daniloff200

@sponkrashin
Copy link

Does anybody know when new package version will be available?

@mcicco
Copy link

mcicco commented Jun 18, 2020

Same issue, any update?

@CharlesDeJager
Copy link

Any idea on when this will be fixed?

@daniloff200
Copy link
Contributor

Should be available in 6.0.0, please, check

@DerZyklop
Copy link

✓ It works for me with 6.0.0

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

Successfully merging a pull request may close this issue.

9 participants