I want to determine if the element is overflowing, and the standard el.clientWidth < el.scrollWidth
works pretty well in Chrome, but for some reason, it has some problems in Firefox.
My guess
My element has box-sizing: border-box
+ some 0.75rem padding. When the element has an overflow that falls exactly in this 0.75rem, Firefox visualizes the overflow, but the scrollWidth
isn’t changing.
Why do I think so? Because clientWidth
in Chrome is changing when I change the box-sizing
property, and the opposite in Firefox.
So how could I check the overflow state of one element which will work in all browsers?