You need to sign in to do that
Don't have an account?
Davide Buoso
offsetHeight/clientHeight getConcreteComponent().getElements() wrong values
I'm trying to dynamically calculate the height of a list (<ul> element with <li> inside).
The problem is if I navigate through the elements printed by 'CONSOLE LOG 1', I get a specific height of the <li> (55 in my case), but the 'CONSOLE LOG 2' it gives me a different value of '33'. (even using the 'offsetHeight' attribute instead of 'clientHeight' I'm having the same problem).
How is this possibile?
({
rerender: function (component, helper) {
this.superRerender();
// ***** CONSOLE LOG 1 *******
console.log(component.getConcreteComponent().getElements());
for (var i = 0; i < component.get('v.listOfSObjects').length && i < component.get('v.limitMobileIteration'); i++) {
// ******* CONSOLE LOG 2 ********
console.log(component.getConcreteComponent().getElements()[0].children.namedItem('ul-list').children.item(i).clientWidth);
}
}
})
The problem is if I navigate through the elements printed by 'CONSOLE LOG 1', I get a specific height of the <li> (55 in my case), but the 'CONSOLE LOG 2' it gives me a different value of '33'. (even using the 'offsetHeight' attribute instead of 'clientHeight' I'm having the same problem).
How is this possibile?
({
rerender: function (component, helper) {
this.superRerender();
// ***** CONSOLE LOG 1 *******
console.log(component.getConcreteComponent().getElements());
for (var i = 0; i < component.get('v.listOfSObjects').length && i < component.get('v.limitMobileIteration'); i++) {
// ******* CONSOLE LOG 2 ********
console.log(component.getConcreteComponent().getElements()[0].children.namedItem('ul-list').children.item(i).clientWidth);
}
}
})