Skip to content

Fix li click event #12

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions inputDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ angular.module('inputDropdown', []).directive('inputDropdown', [function() {
'<ul ng-show="dropdownVisible">' +
'<li ng-repeat="item in dropdownItems"' +
'ng-click="selectItem(item)"' +
'ng-mouseenter="setActive($index)"' +
'ng-mousedown="dropdownPressed()"' +
'ng-tap="selectItem(item)"' +
'ng-mousedown="selectItem(item)"' +
'ng-class="{\'active\': activeItemIndex === $index}"' +
'>' +
'<span ng-if="item.readableName">{{item.readableName}}</span>' +
Expand Down Expand Up @@ -75,7 +75,6 @@ angular.module('inputDropdown', []).directive('inputDropdown', [function() {
scope.$watch('selectedItem', function(newValue, oldValue) {
inputScope.updateInputValidity();

if (!angular.equals(newValue, oldValue)) {
if (newValue) {
// Update value in input field to match readableName of selected item
if (typeof newValue === 'string') {
Expand All @@ -85,11 +84,6 @@ angular.module('inputDropdown', []).directive('inputDropdown', [function() {
scope.inputValue = newValue.readableName;
}
}
else {
// Uncomment to clear input field when editing it after making a selection
// scope.inputValue = '';
}
}
});

scope.setInputActive = function() {
Expand Down