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

enter key on callback is incorrect #6

Open
rippo opened this issue Feb 21, 2022 · 1 comment
Open

enter key on callback is incorrect #6

rippo opened this issue Feb 21, 2022 · 1 comment

Comments

@rippo
Copy link

rippo commented Feb 21, 2022

When hitting enter key to select an item the callback logic is incorrect

I think these lines are wrong

if ('function' === typeof window.resultHandlerBS) {
resultHandlerBS(config.name, results[currentPosition - 1]);
}

and should be replaced with

if (config.callback && typeof config.callback === "function") {
   config.callback(config.name, results[currentPosition - 1]);
}
@kanine
Copy link
Owner

kanine commented Feb 23, 2022

Hi @rippo, I'll have to take a look at it I'm still using this code in a number of internal systems atm but have been crazy busy. I'll check out this suggestion when I'm next updating something using the code.

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

2 participants