Add a custom code to tab change

I am sorry but I do not have a share link since it is disabled in the project and no live link since the page is gated.

I have a tabs component that has a tab pane containing a divblock with overflow auto. I need the divblock to scroll to the bottom on tab change. I am able to scroll the div on the first tab pane on page load to the bottom but sadly when I switch to the other tabs, the tab pane for it is not scrolled down. was planning to put my on pageload code to the tab change, does anyone know in what function should I insert it? other suggestions to make this work is also welcome.

attaching images for reference on the issue

tab 1

tab 2

Thank you

To scroll the div to the bottom you might try assigning it an ID like foo, and then something like this.

var div = document.getElementById('foo');
div.scrollTop = div.scrollHeight;

You can add your own click event handler to your tabs, and then scroll all of the panes to the bottom, or if you want to do something a bit more technical, SA5 has an API for Webflow tabs, which has a tab changed callback.