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

refactor(dialog): Split dialog Foundation#handleInteraction into #handleClick/#handleKeydown. #4655

Merged
merged 12 commits into from
May 2, 2019

Conversation

joyzhong
Copy link
Contributor

@joyzhong joyzhong commented Apr 26, 2019

This allows wrapper libraries to wire up #handleClick to their own custom events.

BREAKING CHANGE: Dialog Foundation#handleInteraction has been split into two methods: #handleClick and #handleKeydown.

packages/mdc-dialog/foundation.ts Outdated Show resolved Hide resolved
packages/mdc-dialog/foundation.ts Show resolved Hide resolved
packages/mdc-dialog/package-lock.json Outdated Show resolved Hide resolved
@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit bcfc394 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit bcfc394 vs. master! 💯🎉

@codecov-io
Copy link

codecov-io commented Apr 30, 2019

Codecov Report

Merging #4655 into develop will decrease coverage by 0.01%.
The diff coverage is 94.44%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4655      +/-   ##
===========================================
- Coverage    98.96%   98.95%   -0.02%     
===========================================
  Files          129      129              
  Lines         6297     6298       +1     
  Branches       821      821              
===========================================
  Hits          6232     6232              
- Misses          64       65       +1     
  Partials         1        1
Impacted Files Coverage Δ
packages/mdc-dialog/component.ts 100% <100%> (ø) ⬆️
packages/mdc-dialog/foundation.ts 99.33% <91.66%> (-0.67%) ⬇️

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 7c78d3a...cda032a. Read the comment docs.

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit b6900b4 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit 50714b1 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit 85523ec vs. master! 💯🎉

Copy link
Collaborator

@abhiomkar abhiomkar left a comment

Choose a reason for hiding this comment

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

Looks good overall! Need to update unit tests based on refactor.

test/unit/mdc-dialog/foundation.test.js Outdated Show resolved Hide resolved
test/unit/mdc-dialog/foundation.test.js Outdated Show resolved Hide resolved
test/unit/mdc-dialog/foundation.test.js Outdated Show resolved Hide resolved
test/unit/mdc-dialog/foundation.test.js Show resolved Hide resolved
test/unit/mdc-dialog/foundation.test.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@abhiomkar abhiomkar left a comment

Choose a reason for hiding this comment

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

Since this is a breaking change merge develop onto your branch and update this PR.

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit 5e47a5a vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit 63d6898 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit cda032a vs. master! 💯🎉

Copy link
Collaborator

@abhiomkar abhiomkar left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

const isClick = evt.type === 'click';
const isEnter = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;
const isSpace = (evt as KeyboardEvent).key === 'Space' || (evt as KeyboardEvent).keyCode === 32;
/** Closes the dialog if scrim or action button click. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Handles click event on dialog root element.

@abhiomkar abhiomkar changed the base branch from master to develop May 2, 2019 14:13
@joyzhong joyzhong merged commit dd54c48 into develop May 2, 2019
@joyzhong joyzhong deleted the dialog branch May 2, 2019 14:17
moog16 pushed a commit that referenced this pull request May 3, 2019
…dleClick/#handleKeydown. (#4655)

BREAKING CHANGE: Dialog `Foundation#handleInteraction` has been split into two methods: `#handleClick` and `#handleKeydown`.
moog16 pushed a commit that referenced this pull request May 14, 2019
…dleClick/#handleKeydown. (#4655)

BREAKING CHANGE: Dialog `Foundation#handleInteraction` has been split into two methods: `#handleClick` and `#handleKeydown`.
moog16 pushed a commit that referenced this pull request May 28, 2019
…dleClick/#handleKeydown. (#4655)

BREAKING CHANGE: Dialog `Foundation#handleInteraction` has been split into two methods: `#handleClick` and `#handleKeydown`.
moog16 pushed a commit that referenced this pull request Jun 3, 2019
…dleClick/#handleKeydown. (#4655)

BREAKING CHANGE: Dialog `Foundation#handleInteraction` has been split into two methods: `#handleClick` and `#handleKeydown`.
abhiomkar pushed a commit that referenced this pull request Jun 11, 2019
…dleClick/#handleKeydown. (#4655)

BREAKING CHANGE: Dialog `Foundation#handleInteraction` has been split into two methods: `#handleClick` and `#handleKeydown`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants