HTML5-placeholder-polyfill
HTML5-placeholder-polyfill copied to clipboard
Placeholder is not shown after rerendering in the react component
I've found this issue in the project. How can I run again placeholders in the didUpdate method? Has this lib an api?
If you want to run the placeholder polyfill always (no matter if the browser natively supports it or not) the you can simply run: $('input[placeholder], textarea[placeholder]').placeHolder();
If you want to use the native Browser implementation when it's available then do the following:
$(function(){
var config = window.placeHolderConfig || {};
if(('placeholder' in $('<input>')[0] || 'placeHolder' in $('<input>')[0]) && !config.forceApply){
// don't run the polyfill when the browser has native support
return;
}
$('input[placeholder], textarea[placeholder]').placeHolder();
});
Hope it helps :-)