Skip to content

Commit

Permalink
Merge pull request #56 from mestremuten/master
Browse files Browse the repository at this point in the history
 Clicks: month/year selects + overlay to close
  • Loading branch information
geoidesic committed Mar 13, 2015
2 parents 17492fe + 4ed4b2f commit e924bcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,14 +623,16 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
// prevent cases where focus is shifted onto external elements
// when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).
// Also, for Firefox, don’t prevent action on the `option` element.
if ( event.type == 'mousedown' && angular.element( target )[0].tagName !== 'input' && target.nodeName != 'OPTION' ) {
if ( event.type == 'mousedown' && angular.element( target )[0].tagName !== 'input' && target.nodeName != 'SELECT' && target.nodeName != 'OPTION' ) {

event.preventDefault()

// Re-focus onto the element so that users can click away
// from elements focused within the picker.
ELEMENT.focus()
}
} else if ( event.type == 'click' && P.get('open') ) {
P.close();
}
});

Expand Down

0 comments on commit e924bcf

Please sign in to comment.