sdecima / javascript-detect-element-resize

A Cross-Browser, Event-based, Element Resize Detection
MIT License
880 stars 151 forks source link

Overflow auto sizing bug on Safari #31

Open zelliott opened 9 years ago

zelliott commented 9 years ago

One of the CSS rules on line 113 (.resize-triggers > div { overflow: auto; }) causes Safari to set overflow on contract-trigger and expand-trigger to auto, obviously. When used with a scrollable div, Safari gives these two divs a smaller width (because of the overflow: auto generates space for an invisible scrollbar) This causes the vertical scrollbar on the div to be un-clickable.

As a fix, I simply removed the overflow: auto rule from the plugin, but am now obviously worried about unknown side-effects. What was the original purpose of this rule?

I'll try to attach a jsbin or something ASAP.

longzheng commented 5 years ago

I've also run into this issue. An alternative I'm testing is adding the .resize-triggers element to the first child of the parent element (rather than the last child like is currently).

This seems to achieve the same outcome (Safari's scrollbars don't block clicks from the other content.