Skip to content
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

feat(dialog): Support default action button #3600

Merged
merged 5 commits into from
Sep 21, 2018

Conversation

kfranqueiro
Copy link
Contributor

@kfranqueiro kfranqueiro commented Sep 20, 2018

Fixes #3593.

Implements default action via a CSS modifier class that can be added to one of the buttons in the actions area of the dialog. If present, pressing enter while focused in the dialog will equate to clicking that button, unless:

  • The keypress came from an excluded element e.g. a textarea or MDC Menu item
  • The default button is disabled (in which case calling click does nothing)

This can be tested live via the baseline-confirmation screenshot test page.

This adds an adapter API and changes another, but this is already encompassed under the general breaking change note for the new Dialog implementation.

@codecov-io
Copy link

codecov-io commented Sep 21, 2018

Codecov Report

Merging #3600 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3600      +/-   ##
==========================================
+ Coverage   98.43%   98.43%   +<.01%     
==========================================
  Files         120      120              
  Lines        5182     5192      +10     
  Branches      645      649       +4     
==========================================
+ Hits         5101     5111      +10     
  Misses         81       81
Impacted Files Coverage Δ
packages/mdc-dialog/constants.js 100% <ø> (ø) ⬆️
packages/mdc-dialog/index.js 100% <100%> (ø) ⬆️
packages/mdc-dialog/foundation.js 100% <100%> (ø) ⬆️

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 4da83dd...6416429. Read the comment docs.

Copy link
Contributor

@williamernest williamernest left a comment

Choose a reason for hiding this comment

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

LGTM

@mdc-web-bot
Copy link
Collaborator

All 545 screenshot tests passed for commit 621065d vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 557 screenshot tests passed for commit 6416429 vs. master! 💯🎉

@kfranqueiro kfranqueiro merged commit 3aa18e2 into master Sep 21, 2018
@kfranqueiro kfranqueiro deleted the feat/dialog-default-action branch September 21, 2018 20:01
@jamesmfriedman jamesmfriedman mentioned this pull request Sep 26, 2018
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants