How to find max height or height of the scrollable ion-content?

Hey there,
I want to get the scroll depth value of ion-content and for this, I’m trying to get the clientHeight of the particular ion-content. Whenever I try to call the clientHeight or even the scroll value. It always comes out to be zero. Since it isn’t giving any value to scroll event our default google analytics scroll depth event isn’t firing up.

you can add a class to your ion-content item (or an ID) and do something like this:

ionViewDidEnter() {
   console.log(document.querySelector('#your-ion-content-item').offsetHeight);
}

Hey there, I feel it’ll not work and still give a 0 since it’s not the exact element which is scrolling. Putting up a life cycle method although guarantees that it actually entered the view but as I’m trying it in the console right after page load that doesn’t makes any difference.

useIonViewDidEnter(() => {
    const ionContent = document.querySelector('ion-content.md.content-ltr') as HTMLElement;
    console.log(ionContent?.offsetHeight);
  });