ginader / HTML5-placeholder-polyfill

Small and robust polyfill for the HTML5 placeholder attribut.
GNU General Public License v2.0
223 stars 85 forks source link

Misplaced placeholders in absolute positioned containers #55

Open henneboele opened 11 years ago

henneboele commented 11 years ago

I have a case where the placeholders are misplaced inside a absolute positioned container. I already added position relative to to div containers wrapping the label and input fields, but no luck. Once the same form is not positioned absolute, all renders fine. See the image attached for a visual impression.

I am using the latest plugin version running on Windows 7 and using IE9.

placeholder_position

henneboele commented 11 years ago

After quite some more debugging it turned out that this issue is related to the display property set to none to hide the absolute positioned container. The placeholder plugin calculates the offset of the input which is always 0 if the element or any of its parents is set to display: none.

Anyone facing this issue should consider changing the css property to visibility: hidden instead.

Authors or contributors may think about a solution bundled with the plugin.