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

The plugin will not work when input(textarea) is hidden #283

Closed
animabear opened this issue Dec 16, 2015 · 3 comments · Fixed by #284
Closed

The plugin will not work when input(textarea) is hidden #283

animabear opened this issue Dec 16, 2015 · 3 comments · Fixed by #284
Assignees
Labels

Comments

@animabear
Copy link

I check the source code and found this:

placeholder = $.fn.placeholder = function(options) {
...
return this.filter((isInputSupported ? 'textarea' : ':input') + '[' + (debugMode ? 'placeholder-x' : 'placeholder') + ']')
                .not('.'+settings.customClass)
                .not(':radio, :checkbox, :hidden') // here

so if input or its ancestor element is hidden when init (it's a normal scene),it won't work.

Could you tell me why use :hidden here ? I make a small changes:

.not(':radio, :checkbox, [type="hidden"]')
@amerikan amerikan self-assigned this Dec 17, 2015
@amerikan amerikan added the bug label Dec 17, 2015
@amerikan
Copy link
Collaborator

@animabear you're right, [type="hidden"] should be used and not :hidden. If you can do a pull request I can merge, if not I can do it myself later.

@amerikan
Copy link
Collaborator

@animabear I have published a new release with this fix.

@animabear
Copy link
Author

@amerikan ok,thanks

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

Successfully merging a pull request may close this issue.

2 participants