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

Feature/autocomplete input #228

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Remove code duplication by merging cases
Zarlex committed Oct 15, 2018
commit 7a1842dcba84771b61274bd2ad339fc299d163fa
10 changes: 5 additions & 5 deletions src/mw-inputs/directives/mw_autocomplete.js
Original file line number Diff line number Diff line change
@@ -192,15 +192,15 @@ angular.module('mwUI.Inputs')
setResult(scope.mwOptionsCollection.selectable.getSelected().first());
}
break;
case 8: //backspace
case 27: //escape
unsetResult();
break;
case 91: //CMD
break;
default:
/* All letters on keyboard */
if (ev.keyCode >= 46) {
if (
ev.keyCode >= 46 || // letters
ev.keyCode === 8 || // backspace
ev.keyCode === 27 // escape
) {
unsetResult();
}
}