wnr / element-resize-detector

Optimized cross-browser resize listener for elements.
MIT License
1.32k stars 118 forks source link

Display block for erd_scroll_detection_container (IE bug fix) #58

Closed mirovelk closed 8 years ago

mirovelk commented 8 years ago

Hi... inline styles display: inline; width: 0px; height: 0px don't make much sense to me. Inline elements don't have width or height. In IE10 it renders as space (an empty line). Is there any reason for this?

In my project I am using css

.erd_scroll_detection_container {
    display: block !important;
}

..this fixed the issue (mo more empty lines in IE) and looks like measurements are working just fine (using this module as a dependency of react-measure -> react-motion-ui-pack)

wnr commented 8 years ago

Hello, and thank you for your PR.

inline styles display: inline; width: 0px; height: 0px don't make much sense to me. Inline elements don't have width or height.

I guess what you mean is that width and height cannot be set of inline elements, so the extra width: 0px; height: 0px; does not do much. So perhaps they should be removed. However, inline elements do have width and height, which one might want to detect resize events of (see #31 or the examples/inline.html), so the injected elements needs to have display:inline.

In IE10 it renders as space (an empty line). Is there any reason for this?

That's strange. I tried to reproduce this issue in IE10 but couldn't see anything weird. Perhaps I misunderstand the issue. Could you perhaps provide a reduced example of the problematic behavior?

Using display: block should work fine, but you would then be limiting yourself to only being able to measure block elements.

react-measure and react-motion-ui-pack looks cool! :)

wnr commented 8 years ago

Closing due to inactivity.

wnr commented 8 years ago

I think that version 1.1.6 fixes your problems without the need of forcing display block.