constisScrollable=function(ele){// Compare the height to see if the element has scrollable content
consthasScrollableContent=ele.scrollHeight>ele.clientHeight;// It's not enough because the element's `overflow-y` style can be set as
// * `hidden`
// * `hidden !important`
// In those cases, the scrollbar isn't shown
constoverflowYStyle=window.getComputedStyle(ele).overflowY;constisOverflowHidden=overflowYStyle.indexOf('hidden')!==-1;returnhasScrollableContent&&!isOverflowHidden;};