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

Cannot read property 'originalObject' of undefined #491

Open
binpur opened this issue May 10, 2017 · 0 comments
Open

Cannot read property 'originalObject' of undefined #491

binpur opened this issue May 10, 2017 · 0 comments

Comments

@binpur
Copy link

binpur commented May 10, 2017

To reproduce:
I have no search history in the dropdown. I focus the input and press enter. I got this error from the console.

Uncaught TypeError: Cannot read property 'originalObject' of undefined
at Scope.angular.module.directive.scope.selectResult (angucomplete-alt.js:693)
at HTMLInputElement.keydownHandler (angucomplete-alt.js:358)
at HTMLInputElement.dispatch (jquery.js:4737)
at HTMLInputElement.elemData.handle (jquery.js:4549)
at HTMLInputElement.wrapped (raven.js:363)

I believe it's because scope.currentIndex is null and it goes into this condition.
if (scope.currentIndex >= 0 && scope.currentIndex < scope.results.length) {
event.preventDefault();
scope.selectResult(scope.results[scope.currentIndex]);
}

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