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

Placeholder class is not removed on input[type='email'] #5

Closed
oliverbenns opened this issue Oct 23, 2014 · 9 comments
Closed

Placeholder class is not removed on input[type='email'] #5

oliverbenns opened this issue Oct 23, 2014 · 9 comments

Comments

@oliverbenns
Copy link
Contributor

Any text added to the input is also treated as a placeholder (is removed when refocused).

@fidian
Copy link
Contributor

fidian commented Oct 23, 2014

Would you tell me more information? For instance, is it in all browsers or a specific browser/version that you are seeing this behavior?

@oliverbenns
Copy link
Contributor Author

Hey. Yep I'm experiencing this in Chrome, so I'm expecting all browsers.

So the original placeholder appears as normal, I click the input field, the placeholder disappears as expected.

However, it fails to remove the .placeholder class, giving me .placeholder styles.

Then, if I blur the input, and refocus into it, any text that I've entered into it is removed (acting like a placeholder).

@fidian
Copy link
Contributor

fidian commented Oct 24, 2014

Before I try to replicate the behavior with a fiddle of my own, do you have somewhere online that I can see this behavior? Also, what OS are you using and what version of Chrome are you running? It shouldn't matter, but I'd like to make sure that I test with as similar of an environment as possible.

@oliverbenns
Copy link
Contributor Author

Yeah absolutely.

Browser: Chrome 38.0.2125.104
Angular: v1.2.0
OS: Mac Yosemite

Unfortunately I can't upload it as it's a company project. We defaulted to a type=text field in the end (client deadlines). But you can view the test environment here: url removed 9/4/2015 . It'll be up for a week or so, hope this helps.

@fidian
Copy link
Contributor

fidian commented Oct 24, 2014

Interestingly, this is because of the validation associated with <input type="email">. I found discussion on this as Angular issue #1426. I guess I can't use the model's value and instead much check if the element has a value. I have a demo up on Plunker that really shows this off well. Enter a valid email and the form below updates. Any time the email is invalid, the value on the model is empty.

@fidian
Copy link
Contributor

fidian commented Apr 8, 2015

I made a change that works for me - could you test the issue-5 branch to see how well it works for you?

@CullenShane
Copy link

Issue-5 branch is working quite nicely for this issue.

@vitvad
Copy link

vitvad commented Aug 11, 2015

Issue-5 branch fix this issue and seems fix issues/9

@fidian
Copy link
Contributor

fidian commented Aug 11, 2015

Merged.

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

4 participants