Hi I’m accessing the ion-content component to attach a scroll listener.
when getting the dimensions through getContentDimensions()
the numbers don’t quite add up:
“contentHeight”:683,
“contentTop”:0,
“contentBottom”:683,
“scrollHeight”:752,
“scrollTop”:180,
“scrollBottom”:932,
it should be like this:
scrollHeight - contentHeight = maxScrollTop
but contentHeight
also includes 56px top and 56px bottom margin for the header and tab-bar that I have.
Is there any way to get the 56px margins through the component without messing with the HTMLElements directly ?
Searching and accessing the automatically inserted <div class='scroll-content'...
will give me the proper contentHeight, but I’d rather not touch any of that in case the implementation changes.
PS: this gets the proper dimensions too, but touches HTMLElement:
contentHeight = content.getScrollElement().offsetHeight
topMargin = content.getScrollElement().offsetTop
(Sidenote, it’s still off by 1px, but that might be a rounding error happening somewhere)
Thanks