Skip to content
This repository was archived by the owner on Dec 16, 2019. It is now read-only.

Commit a0f2152

Browse files
committed
Merge branch 'Fix-1.3.0' into Fix-1.4.0
* Fix-1.3.0: Disable keyboard controls when not turned on in settings
2 parents 3ebbb3a + b7ad4a1 commit a0f2152

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/angularjs-dropdown-multiselect.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
333333
var sourceScope = angular.element(event.target).scope();
334334
var nextOption;
335335
var parent = event.srcElement.parentNode;
336+
if (!$scope.settings.keyboardControls) {
337+
return;
338+
}
336339
if (event.keyCode === 13 || event.keyCode === 32) { // enter
337340
event.preventDefault();
338341
if (!!sourceScope.option) {
@@ -380,6 +383,9 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
380383
$scope.keyDownSearchDefault = function(event) {
381384
var parent = event.srcElement.parentNode.parentNode;
382385
var nextOption;
386+
if (!$scope.settings.keyboardControls) {
387+
return;
388+
}
383389
if (event.keyCode === 9 || event.keyCode === 40) { //tab
384390
event.preventDefault();
385391
setTimeout(function() {
@@ -408,6 +414,9 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
408414

409415
$scope.keyDownSearchSingle = function(event, searchFilter) {
410416
var searchResult;
417+
if (!$scope.settings.keyboardControls) {
418+
return;
419+
}
411420
if ($scope.settings.selectionLimit === 1 && $scope.settings.enableSearch) {
412421
if (event.keyCode === 13) {
413422
searchResult = $filter('filter')($scope.options, $scope.getFilter(searchFilter));

0 commit comments

Comments
 (0)