-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Added input error for required text field #120
Added input error for required text field #120
Conversation
This is my initial start to adding validation to the input fields. I'll be adding other stuff soon such as max characters, email validation, etc. Let me know if you'd like to change anything with my approach so far. |
Let me just give you some general advice, considering my experience in porting components from angular material and the direction of this project (especially #119).
The thing is that the current ember text field has a lot of old stuff ported from polymer. We should try our best to align ourselves with angular material. That way we can get all the benefits from a larger community (and maybe give back something as well). Love the tests. |
Thanks for the comments Miguel. So is the goal to basically port the Angular implementation over to Ember? If so, what would you like to do with all the "ng-whatever" DOM elements and stylsheets? For example, in Angular's DOM, they have ng-message attributes for each error.
I used Also, how much refactoring of the old polymer code would you like to see? I didn't want to change much for my first pull request; all my changes were additions to existing code. Thanks Miquel. You've done a great job so far and I hope I can help check things off your todo list. |
If their styles use From a first look, it looks like we may have some problems with animations because it looks like they're using ngAnimate. If you have any problems, post here we'll certainly solve it together! |
Ok, for this last commit, I basically took all of angular's input.scss and input-theme.scss and put it into your paper-text-scss. I had to change md-input-group to md-input-container to match the css. I'm playing with the transition for the error text. |
I've added the rest of the validation and also the tab fix that you asked for. The only thing missing (from the angular implementation) is the animation. I'm not going to be able to work on it this week because of my real job. Are you thinking of merging it into master? |
@DanMonroe No problem. I'll try to have a look at the animation issue if I have the time. This will be merged into master when it is complete. Good job. |
I've added fade in and fade out animation for the errors. I created a separate animation.scss file that currently has my two animations, however, we can add a lot more animations. These were based off of http://daneden.github.io/animate.css/ |
No success in using the existing angular material classes for animation? Angular uses ngAnimate. Ideally we should come up with a mixin that mimics the necessary ngAnimate's functionality, and reuse it for other components. |
Ok, I'll try to use the ngAngular animations during lunch today. |
I've added ng-animation.scss for use throughout the project. I've updated paper-text to use the ng animations. |
Can you elaborate? Why do we need the |
You're right. I didn't see the existing transforms when I searched earlier. I removed ng-animation.scss and I believe that everything is in place now. |
@DanMonroe THIS IS RAD! Awesome job. I'm just getting an error with sass:
Corresponds to this line: md-input-container.md-#{$theme-name}-theme {
.md-input {
&::-webkit-input-placeholder, /* <----- 263 is here */
&::-moz-placeholder, /* Firefox 19+ */
&:-moz-placeholder, /* Firefox 18- */
&:-ms-input-placeholder {
color: color($foreground, '3');
} Even the syntax highlight is a bit messed up. The sass compiles without any problems at your side? I deleted that stuff to check the changes, and it's really good. Got some "bugs" because I deleted the problematic rule, but apart from that, it's looking great! Also, I think we should drop any I think there's missing a |
My ember build works. I don't know, maybe it was the comments it didn't like. I removed them just in case. The I didn't put in the OK, so now I'm really done with this pull request unless you think there is anything else you want me to do. :) |
Tremendous job, @DanMonroe. Thank you. |
No description provided.