From fb6e1702fd045fb5b829c636964811249673c68d Mon Sep 17 00:00:00 2001
From: Rex Strowbridge <Rex Strowbridge>
Date: Sun, 8 Jan 2017 21:18:47 -0800
Subject: [PATCH] Modified the dist/angular-selector.js file to fix issue #21 -
 Dropdown closing on scroll click in IE and Edge

---
 dist/angular-selector.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/dist/angular-selector.js b/dist/angular-selector.js
index c29ef2f..3bf86ce 100644
--- a/dist/angular-selector.js
+++ b/dist/angular-selector.js
@@ -512,13 +512,27 @@
 				}, true);
 				
 				// DOM event listeners
+				scope.preventClose = false;
+				
 				input = angular.element(element[0].querySelector('.selector-input input'))
 					.on('focus', function () {
+						
+						if(scope.preventClose) {
+							scope.preventClose = false;
+							return;
+						}
+						
 						$timeout(function () {
 							scope.$apply(scope.open);
 						});
 					})
 					.on('blur', function () {
+						
+						if(scope.preventClose) {
+							input.focus();
+							return;
+						}
+						
 						scope.$apply(scope.close);
 					})
 					.on('keydown', function (e) {
@@ -531,6 +545,7 @@
 					});
 				dropdown
 					.on('mousedown', function (e) {
+						scope.preventClose = true;
 						e.preventDefault();
 					});
 				angular.element($window)