Report changes to the dimensions of an Element's scrollWidth and scrollHeight
Scrollview Resize provide the solution that we can report changes to the dimensions of an Element's scrollWidth and scrollHeight.
npm install scrollview-resize
// or yarn
yarn add scrollview-resize
ResizeObserver
is used in the code, IE dont support it, so you need polyfill for that.
import { SVResizeObserver } from 'scrollview-resize';
const el = document.querySelector('selector');
const observer = new SVResizeObserver(() => {
console.log('Scroll size changed');
});
observer.observe(el);