-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(select): add adapter #3233
fix(select): add adapter #3233
Conversation
All 128 screenshot tests passed for commit e63a2ed vs. |
…ents/material-components-web into fix/select/add-adapter
Codecov Report
@@ Coverage Diff @@
## master #3233 +/- ##
=========================================
Coverage ? 98.36%
=========================================
Files ? 120
Lines ? 5130
Branches ? 639
=========================================
Hits ? 5046
Misses ? 84
Partials ? 0
Continue to review full report at Codecov.
|
All 128 screenshot tests passed for commit 974641d vs. |
All 128 screenshot tests passed for commit cc624d2 vs. |
packages/mdc-ripple/adapter.js
Outdated
@@ -38,6 +38,7 @@ | |||
* | |||
* @record | |||
*/ | |||
|
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.
How'd this get into this PR? Is this fixing anything?
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.
hmm weird...don't remember that
packages/mdc-select/README.md
Outdated
| `getValue() => string` | Returns the value selected on the `select` element. | | ||
| `hasClass(className: string) => boolean` | Returns true if the root element has the className in its classList. | | ||
| `hasLabel() => boolean` | Returns true if the `select` has a label associated with it. | | ||
| `hasOutlined() => boolean` | Returns true if the `select` has the notched outline element. | |
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.
Typo: hasOutlined -> hasOutline
packages/mdc-select/README.md
Outdated
| `activateBottomLine() => void` | Activates the bottom line component. | | ||
| `addClass(className: string) => void` | Adds a class to the root element. | |
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.
I think we have typically kept correlated APIs together, so can we move removeClass and hasClass back here, and put APIs for the label / outline each together, etc?
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.
gotcha - i alpha sorted
packages/mdc-select/adapter.js
Outdated
addClass(className) {} | ||
|
||
/** | ||
* Removes a class from the root Element. |
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.
Element -> element to be consistent with other docs
packages/mdc-select/adapter.js
Outdated
hasLabel() {} | ||
|
||
/** | ||
* Only implement if label exists. |
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.
I would rephrase all of these "Only implement" comments, e.g. "Returns width of label in pixels, if the label exists."
The adapter APIs are always implemented, but ones like this simply return early if the element in question doesn't exist.
packages/mdc-select/foundation.js
Outdated
@@ -64,18 +83,27 @@ export default class MDCSelectFoundation extends MDCFoundation { | |||
} | |||
} | |||
|
|||
/** | |||
* Handles value event changes. |
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.
Handles value changes, via change event or programmatic updates.
All 128 screenshot tests passed for commit 9967eb8 vs. |
…ts/material-components-web into fix/select/add-adapter
All 128 screenshot tests passed for commit 9dc3f0b vs. |
All 128 screenshot tests passed for commit 59d39df vs. |
a3d795d
to
597f587
Compare
597f587
to
1776e5c
Compare
All 140 screenshot tests passed for commit 3200c8e vs. |
All 140 screenshot tests passed for commit e31bc21 vs. |
(cherry picked from commit 43b3ac1)
No description provided.