Skip to content

Commit a939d47

Browse files
committed
PV5-2850 adding touchend event for mobile
The click event doesn't get bubbled up to the document on mobile, so I'm adding a touchend event to close the dropdown menu.
1 parent 579d33d commit a939d47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/uiSelectDirective.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ uis.directive('uiSelect',
201201
}
202202

203203
// See Click everywhere but here event http://stackoverflow.com/questions/12931369
204-
$document.on('click', onDocumentClick);
204+
$document.on('click touchend', onDocumentClick);
205205

206206
scope.$on('$destroy', function() {
207-
$document.off('click', onDocumentClick);
207+
$document.off('click touchend', onDocumentClick);
208208
});
209209

210210
// Move transcluded elements to their correct position in main template
@@ -372,7 +372,7 @@ uis.directive('uiSelect',
372372
};
373373

374374
var opened = false;
375-
375+
376376
scope.calculateDropdownPos = function() {
377377
if ($select.open) {
378378
dropdown = angular.element(element).querySelectorAll('.ui-select-dropdown');

0 commit comments

Comments
 (0)