Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

feat(select): Add enhanced select variant #3949

Merged
merged 15 commits into from
Oct 26, 2018
Merged

Conversation

williamernest
Copy link
Contributor

@williamernest williamernest commented Oct 22, 2018

Adds the leading icon variant to the select.
Adds the helper text to the select.
Adds the rotating dropdown icon to the select.
Adds the enhanced menu version of the select.
fixes #2552, fixes #3706, fixes #3629, fixes #3627, fixes #3628, fixes #291, fixes #3728, fixes #3648, fixes #3729, fixes #2275, fixes #2211, fixes #2227, fixes #1835
BREAKING CHANGE: Several adapter APIs were added to support the enhanced variant. The drop-down arrow is now its own element. The change event is now MDCSelect:change for all variants. See the README for full details.

@codecov-io
Copy link

codecov-io commented Oct 22, 2018

Codecov Report

Merging #3949 into master will decrease coverage by <.01%.
The diff coverage is 97.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3949      +/-   ##
==========================================
- Coverage   98.48%   98.48%   -0.01%     
==========================================
  Files         120      126       +6     
  Lines        5227     5594     +367     
  Branches      657      746      +89     
==========================================
+ Hits         5148     5509     +361     
- Misses         79       85       +6
Impacted Files Coverage Δ
packages/mdc-select/constants.js 100% <ø> (ø) ⬆️
packages/mdc-select/icon/index.js 100% <100%> (ø)
packages/mdc-select/icon/constants.js 100% <100%> (ø)
packages/mdc-select/helper-text/constants.js 100% <100%> (ø)
packages/mdc-select/icon/foundation.js 100% <100%> (ø)
packages/mdc-select/helper-text/index.js 100% <100%> (ø)
packages/mdc-select/helper-text/foundation.js 100% <100%> (ø)
packages/mdc-select/foundation.js 97.52% <96.42%> (-2.48%) ⬇️
packages/mdc-select/index.js 97.68% <97%> (+1.25%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19b5152...46a2efa. Read the comment docs.

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine, but has merge conflicts with #3929. Since you also reviewed that, could you take a look at the conflicts?

Also FYI I added a BREAKING CHANGE note into the PR description to use for the commit.

.travis.yml Outdated
@@ -13,6 +13,7 @@ branches:
# This prevents excessive resource usage and CI slowness.
only:
- master
- feat/select-new
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this before merging

if (this.menuElement_) {
this.selectedText_.addEventListener('keydown', this.handleKeydown_);
this.menu_.listen(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);
// Menu should open to the last selected element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this comment into the body of handleMenuOpened_ (around L279)

@mdc-web-bot
Copy link
Collaborator

@mdc-web-bot
Copy link
Collaborator

@include mdc-select-outline-color($mdc-select-outlined-idle-border);
@include mdc-select-hover-outline-color($mdc-select-outlined-hover-border);
@include mdc-select-focused-outline-color(primary);
@include mdc-floating-label-float-position($mdc-select-outlined-label-position-y);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is now redundant since mdc-select-outline-shape-radius invokes this a few lines later. This line was removed in #3929 (and was one of the conflicts listed earlier, I think).

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs one more rebase but then LGTM presuming no unexpected screenshot diffs.

I put a BREAKING CHANGE note in the PR description, copy that into the commit description (and tweak if you like).

@mdc-web-bot
Copy link
Collaborator

@mdc-web-bot
Copy link
Collaborator

@mdc-web-bot
Copy link
Collaborator

🤖 Beep boop!

Screenshot test report 🚦

124 screenshots changed from master on commit fa07f23:

Details

36 Changed:

88 Added:

@mdc-web-bot
Copy link
Collaborator

🤖 Beep boop!

Screenshot test report 🚦

124 screenshots changed from master on commit 12f648e:

Details

36 Changed:

88 Added:

@mdc-web-bot
Copy link
Collaborator

🤖 Beep boop!

Screenshot test report 🚦

124 screenshots changed from master on commit afb8cd7:

Details

36 Changed:

88 Added:

@mdc-web-bot
Copy link
Collaborator

🤖 Beep boop!

Screenshot test report 🚦

124 screenshots changed from master on commit 46a2efa:

Details

36 Changed:

88 Added:

@williamernest williamernest merged commit 35697a5 into master Oct 26, 2018
@porfirioribeiro
Copy link

I don't know much about MDC internals, but couldn't helper-text and probably icon be moved to their own component avoiding code duplication? As you did with line-ripple

@williamernest
Copy link
Contributor Author

@porfirioribeiro That is the plan in the future. We didn't have time for this release to separate the internals into their own packages but we'll end up doing that in the long run.

@williamernest williamernest deleted the feat/select-new branch October 26, 2018 21:06
@porfirioribeiro
Copy link

Ok thats great, avoiding code duplication if you use both.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.