-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(text-field): Add foundation.setValue method #1615
feat(text-field): Add foundation.setValue method #1615
Conversation
Returns whether or not the label element contains the given class.
d1d2069
to
11689fa
Compare
Codecov Report
@@ Coverage Diff @@
## master #1615 +/- ##
=========================================
+ Coverage 99.4% 99.4% +<.01%
=========================================
Files 78 78
Lines 3522 3547 +25
Branches 426 430 +4
=========================================
+ Hits 3501 3526 +25
Misses 21 21
Continue to review full report at Codecov.
|
ddfa1c5
to
c424e1a
Compare
It's ready for a review |
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.
So many tests! Look at you go!!
packages/mdc-textfield/constants.js
Outdated
@@ -24,6 +24,7 @@ const strings = { | |||
ICON_SELECTOR: '.mdc-text-field__icon', | |||
ICON_EVENT: 'MDCTextField:icon', | |||
BOTTOM_LINE_SELECTOR: '.mdc-text-field__bottom-line', | |||
INPUT_PROTO_PROP: 'value', |
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.
this one snuck in here
packages/mdc-textfield/foundation.js
Outdated
updateLabelFloat_() { | ||
const input = this.getNativeInput_(); | ||
const {LABEL_FLOAT_ABOVE} = MDCTextFieldFoundation.cssClasses; | ||
|
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.
add a
const labelFloatIsActive = this.adapter_.labelHasClass(LABEL_FLOAT_ABOVE);
Then reference labelFloatIsActive
instead of this.labelFloatIsActive_
for the rest of this method
packages/mdc-textfield/foundation.js
Outdated
@@ -78,6 +79,8 @@ class MDCTextFieldFoundation extends MDCFoundation { | |||
this.receivedUserInput_ = false; | |||
/** @private {boolean} */ | |||
this.useCustomValidityChecking_ = false; | |||
/** @private {boolean} */ |
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.
You won't need this.labelFloatIsActive_
after you change this to a const with the updateLabelFloat_
method
@lynnjepsen Please review |
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.
LGTM
…ts#1631) BREAKING CHANGE: Please update implementations of MDCTextFieldAdapter to implement getInputFoundation(). Methods registerInputInteractionHandler()/deregisterInputInteractionHandler() have been renamed to registerInputEventHandler()/deregisterInputEventHandler(). getNativeInput() is no longer in MDCTextFieldAdapter. See the README for mdc-textfield/input for more information.
It looks like there are a few merge conflicts that have cropped up. @lynnjepsen is this a case where we are waiting for other things to land before merging? |
Hey @anton-kachurin I had meant to merge this PR before we did refactoring on mdc-text-field...but missed my opportunity. I even tried to merge this up to master, but it's quite a lot of merge conflicts. I think our best bet at getting this logic into mdc-text-field is for you to comment on #1740. @bwobrien is adding a I'm going to close this...but please leave comments on #1740 if there is something you think is missing. |
BREAKING CHANGE: Please update implementations of MDCTextFieldAdapter to implement the method labelHasClass