-
-
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
Fixed double sending of onInvalid action #406
Fixed double sending of onInvalid action #406
Conversation
Does it make sense for the action to send up the value ( |
We can do either. That's up to you guys. Both can work for me. I think the boolean coercion would make it simpler for people not reading the source code of the paper-input; however, differentiating null from false in the component helps tell whether it's invalid prior to being touched or after. |
Implementing a better solution and then I'll reopen. |
… TRUE on isInvalid
Not sure why the tests fail? They pass with ember test... |
What does this include the paper-form component, just like #408? |
export default Ember.Component.extend({ | ||
tagName: '', | ||
attributeBindings: ['style'], | ||
style: "width:100%", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're only using single quotes. This should lead to a failing jscs error in the tests.
… TRUE on isInvalid
This reverts commit f987daf.
This reverts commit 73029e9.
…er-paper into fix-input-validation
* Changed the way the paper-input component and input element share values. With this, values are consistent between the element and component at all times * Added comments. Moved action. Simplified didRender
Cleaned up the code a little to use the local var.
Main point: Fix specifically when onInvalid sends.
Because onInvalid is triggered when !== to lastIsInvalid, null and false values triggered two separate onInvalid calls.
As far as validity goes, these two are one in the same. Added !! to the if so that if the case is null !== false, it will now be false !== false and not send the extra onInvalid call.