Solved by CSS Scroll-Driven Animations: Detect if an element can scroll or not
onBecause Scroll-Driven Animations are only active when there is scrollable overflow, it is possible to use them as a mechanism to detect if an element can scroll or not.