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

Fix dropdown auto close in mobile phones for angular ~1.4.7 #4643

Closed
wants to merge 1 commit into from

Conversation

solispauwels
Copy link

Auto close dropdowns when click was broken in mobile phones with angular ~1.4.7

@icfantv
Copy link
Contributor

icfantv commented Oct 16, 2015

Please create a functional test that checks for this event handler being added, triggered, and removed.

@@ -23,6 +24,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
this.close = function(dropdownScope) {
if (openScope === dropdownScope) {
openScope = null;
$document.unbind('touch', closeDropdown);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job on remembering this - it's REALLY easy to forget to do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I close it because I realize that the thing that was wrong and nonfunctional were the $document.bind (mobilephone) in angular ~1.4.7 so my code does not fix anything... I am looking what is going on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problems seems to happend only in elements with ng-click attribute and with ngTouch enabled

@solispauwels
Copy link
Author

ngTouch rewrites ngClick and cause problems in dropdowns that are not auto close properly.

comment angular-touch.js line 159 and 160 fix the problem.

https://github.com/angular/angular.js/blob/master/src/ngTouch/directive/ngClick.js#L159

@solispauwels
Copy link
Author

angular/angular.js#13122

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants