Ionic upgrade 1.0.0-beta-8 to 1.0.0-beta-10 floating div ng-click issue

Hi,

Our current application is using ionic-1.0.0.beta-8, we recently upgraded to 1.0.0.beta-10.

One of functionality seems to have broken.

In a modal I have a input field doing typeahead. In newer version typeahead works but we couldn’t select from the list (I mean ng-click event is not firing when I select).

Digging further with code difference, we noticed in beta-9 below change has been made which is causing the issue.

In beta-8

function tapContainingElement(ele, allowSelf) {
var climbEle = ele;
for(var x=0; x<6; x++) {
if(!climbEle) break;
if(climbEle.tagName === ‘LABEL’) return climbEle;
climbEle = ele.parentElement;
}
if(allowSelf !== false) return ele;
}

in beta-9

function tapContainingElement(ele, allowSelf) {
var climbEle = ele;
for(var x=0; x<6; x++) {
if(!climbEle) break;
if(climbEle.tagName === ‘LABEL’) return climbEle;
climbEle = climbEle.parentElement;
}
if(allowSelf !== false) return ele;
}

Can one you please let us know why this change is implemented, if I revert back the one line highlighted then all works as needed.

Kind Regards
Kay

Heres the commit to look at the reasoning.

hi @developeronex,

I have the same issue. Do you find a way to resolved it ?

Regards

Sorry augbar, was on a vacation for a while. I am not still sure about adambradley’s ancestor label element fix. I modified ionic version as we had a quick deliverable.

Changes I did is in ionic 11 js file

climbEle = ele.parentElement;

to

climbEle = climbEle.parentElement;

For example if you are using angular UI bootstrap typeahead, we cannot select the element of results as its a floating div.

This changed i did should do.

I guess there should a condition clause for it which is missing.

Here is a plunker to explain more.

When we do a search we can see the list but unable to select from the list.

In ionic.js If i change this

if(climbEle.tagName === ‘LABEL’) return climbEle;
climbEle = climbEle.parentElement;
}

to

if(climbEle.tagName === ‘LABEL’) return climbEle;
climbEle = ele.parentElement;
}

All works as expected.

Any help appreciated.