Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholders do not work in IE7 Standards when being emulated by IE10 #28

Open
seiyria opened this issue Jun 7, 2013 · 5 comments
Open
Labels

Comments

@seiyria
Copy link

seiyria commented Jun 7, 2013

Using IE10 to emulate IE7 on Windows 7 causes the placeholders to not show up. A screenshot of the Placeholders site in my environment: http://puu.sh/3amKt.png

However, it seems using IE8 to emulate IE7 (on XP) works: http://cl.ly/image/450h3V2T2e2e

@jamesallardice
Copy link
Owner

Thanks for reporting this. It's definitely a bug, but I can't work out what is going on. IE10 dropped into IE7 standards mode seems to somehow remove the placeholder attribute from the elements (although it shows up in the DOM inspector). Attempting to get the value of the attribute via getAttribute always returns null.

This is not the case for IE8 or 9 emulation, both of which appear to work as expected.

@jamesallardice
Copy link
Owner

Currently, we are checking for the presence of a placeholder attribute on each input and textarea element in the DOM as follows:

placeholder = elem.getAttribute("placeholder");

The only way I can see so far that this issue could be fixed is to use the Node.attributes property, which does seem to contain the correct value for the placeholder attribute. Something like this:

placeholder = elem.getAttribute("placeholder") || elem.attributes.placeholder;

I'm questioning the value of this fix, since IE10 dropped into IE7 mode is something that should only be done for testing, but it is a relatively simple fix so I think I will probably include it.

@jamesallardice
Copy link
Owner

Fixed as of 2.1.0 release.

@Florisschimandl
Copy link

It does work when entering a page. But when you refresh (f5) a page all placeholders change into values and thus show up as normal black text. (Using latest IE10 to emulate IE7 on Windows 8)

@jamesallardice
Copy link
Owner

@Florisschimandl Thanks, confirmed. I'll reopen this and try to fix that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants