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

Default value on inactive tab failed on Chrome #5

Open
ghost opened this issue Sep 19, 2013 · 2 comments
Open

Default value on inactive tab failed on Chrome #5

ghost opened this issue Sep 19, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 19, 2013

The problem only appears on Chrome (tested on Chrome 29.0.1547.66 m).

I have a use case where a user can modify an <input> value using an html <a> element. If this link is open in a new browser tab (using CTRL+click), input value is not visible in the new opened tab until the user manually focus the <input> field.
It seems to be related to this code :

// swap if there is a default value
if ($(this).val() != ''){
    hint.focus();
};

Cause the new opened tab is not active when the plugin is applied, the code associated to the focus event binded to the input doesn't seem to be executed.

I bypassed the problem by extracting the code defined in the focus event binding to a function and calling this function in the above code instead of triggering the focus event.
There might be a better way ?

@Eonasdan
Copy link
Contributor

chrome supports the the placeholder attributes, why are you using a plugin to do this? The plugin's main goal is to support ancient IE browsers

@ghost
Copy link
Author

ghost commented Sep 19, 2013

Mainly because it is a jsf inputText (for binding purpose) that does not support the placeholder attribute.
(I need to support older browsers too)

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

No branches or pull requests

1 participant