Configurable maximum element nesting


#1

Hi,

One of my view has a complex layout. And within this layout, I’m using a custom input directive.

When I’m tapping on this input directive, the keyboard shows up but the viewport is not resized and the scroll does not happen.

I’ve found what is causing the problem in ionic_bundle.js :
getParentWithClass: function(e, className, depth) {
depth = depth || 10

I’ve changed the maximum to 20 to fix my problem, but is it possible to make this a configurable value?

I planned to migrate to ionic 2 this summer. Maybe it won’t be a problem anymore …


#2

You can override ionic function by below codes, I did same thing and the issue has been fixed.

ionic.DomUtil.getParentWithClass = function(e, className, depth) {
depth = depth || 30;
while (e.parentNode && depth–) {
if (e.parentNode.classList && e.parentNode.classList.contains(className)) {
return e.parentNode;
}
e = e.parentNode;
}
return null;
};