mathiasbynens / jquery-placeholder

A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet
https://mths.be/placeholder
MIT License
3.98k stars 1.34k forks source link

Placeholders not appearing for password input #267

Closed ajbeaven closed 8 years ago

ajbeaven commented 9 years ago

When I use jquery.placeholder.js on IE9, placeholders do not appear for password inputs, however when I used the minified versions, it does work correctly.

At least one commit I found only updated the minified version and not the non-minified version though I'm unsure if there are others that have been missed:

https://github.com/mathiasbynens/jquery-placeholder/commit/b3055b0b5eaef2b89b22e0898fb8ab930425b491

jquery-placeholder version: v2.1.2 jquery vesion: v1.11.1 browser version: IE9 (emulated)

amerikan commented 9 years ago

@ajbeaven I have minified latest version which is v2.1.3. Please test, let me know if the issue still persists, otherwise I'll close this issue in a few days.

ajbeaven commented 9 years ago

Sorry, I think you did it the wrong way around. The minified version was the one that worked. If you check out https://github.com/mathiasbynens/jquery-placeholder/commit/b3055b0b5eaef2b89b22e0898fb8ab930425b491 you'll see that there were no changes to the non-minified version. The change you've just done to re-minify has since broken the minified version.

I wonder if it's better to take pull requests that only change jquery.placeholder.js and then manually update jquery.placeholder.min.js yourself to stop issues like this? That also protects against people slipping in malicious changes to minified commit. Just a thought - I'm not hugely experienced with git and so am not sure if this is common practice, but it makes sense to me ;)

ajbeaven commented 9 years ago

Sorry, I should also mention that this is only apparent when you use IE9 in emulation mode, as per the comment attached to that commit.

amerikan commented 9 years ago

@ajbeaven then something in latest version broke it... As far as minification, I'm the only one who minifies it and I don't accept PR's with minifications.

I'll test it out to see if I can reproduce the bug you're encountering.

amerikan commented 9 years ago

@ajbeaven Using the latest code, I'm able to run the demo page just fine with passwords.

Test env: Windows 7, IE 9 emulated in my IE10 browser.

The only difference is that the demo page is using jQuery 1.10.2 and you're using v1.11.1.

See screenshot:

screen shot 2015-09-23 at 4 25 08 pm

So you can try two things if you're already using latest minified version already:

ajbeaven commented 9 years ago

Well that's weird. Move type=tel and type=password outside of their container divs (so they're direct direct children of the form) and you'll be able to reproduce the problem. This doesn't happen with the old minified version I was using previously.

capture

amerikan commented 9 years ago

I've simplified the demo page and can now reproduce.

amerikan commented 9 years ago

@ajbeaven Do you know which was the minified version you were using when it was working?

ajbeaven commented 9 years ago

I think it was the one in the commit referenced up the top: https://github.com/mathiasbynens/jquery-placeholder/blob/b3055b0b5eaef2b89b22e0898fb8ab930425b491/jquery.placeholder.min.js

jlmainguy commented 8 years ago

Hi, I am using the latest minified version and I'm also experiencing this bug in IE8-9 on my website as well as on the demo itself. I'm using VMs on Virtual Box on OSX. IE9 on Win7 and IE8 on XP.

placeholder-1 placeholder-2
amerikan commented 8 years ago

@jlmainguy this is a known issue. Please use older version of plugin. I will try to get this fixed soon.

amerikan commented 8 years ago

Hmmm, ok so this bug was introduce in this commit on this line https://github.com/mathiasbynens/jquery-placeholder/commit/4902ebee327a42cc172e0e7fe8800257ef287087#diff-fdadbd15fd58f358cf360bf123640125R168

amerikan commented 8 years ago

@jlmainguy @ajbeaven I just push a fix into jquery.placeholder.js in the gh-pages branch, can you grab it and test to see if this issue is resolved? I tested it and it now works for me.

amerikan commented 8 years ago

This has been fixed in v2.2.0.