Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feat/overlay escape key #560

Merged
merged 4 commits into from
Dec 16, 2020
Merged

Feat/overlay escape key #560

merged 4 commits into from
Dec 16, 2020

Conversation

ShmuelLotman
Copy link
Contributor

Changes

Enables overlay closing on escape keypress

// Describe what you changed
When you pass the state handler for the visible prop into the onEscape prop for overlays, it will now be able to close on escape press

Screenshots

// Add screenshots here if relevant

Checklist

Check all that apply

  • Updated documentation to reflect changes
  • Added entry to top of Changelog with link to PR (not issue)
  • Tests pass
  • Peer reviewed and approved
  • Signed CLA (if not already signed)

Comment on lines 62 to 64
if (!visible) {
return null
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to make this change work without returning null? It sidesteps all the work that went into animating the overlays in/out

Comment on lines 118 to 120
const Overlay = <OverlayRender />

return addElementToPortal(overlay)
return addElementToPortal(Overlay)
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this different than just calling the function?

return addElementToPortal(OverlayRender())

Copy link
Contributor

@alexpaxton alexpaxton left a comment

Choose a reason for hiding this comment

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

LGTM, nice work man thanks for contributing

@alexpaxton alexpaxton merged commit 180308d into master Dec 16, 2020
@alexpaxton alexpaxton deleted the feat/overlay-escape-key branch December 16, 2020 20:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants