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

Fix Issue #1039 : extending KeyboardShortcut to Support Special Keys #1180

Closed
wants to merge 16 commits into from
Closed

Conversation

f0wu5u
Copy link

@f0wu5u f0wu5u commented Jan 6, 2021

<If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit.>

Details

Added Escape key listener to close all modals using existing KeyboardShortcut library. KeyboardShortcut library was also modified to accept single keys by passing special as modifier when subscribing for event.

Fixed Issues

Fixes #1039

Tests

Close Image upload preview:

  1. Go to chat screen of Expensify.cash
  2. Click on image upload button and select image for preview
  3. Press Escape button and modal should close

Close Attachment preview modal:

  1. Press on any image in chat
  2. Wait for preview modal
  3. Press Escape and modal should close

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

record.mp4

@f0wu5u f0wu5u requested a review from a team as a code owner January 6, 2021 01:46
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@botify botify requested review from alex-mechler and removed request for a team January 6, 2021 01:46
@f0wu5u
Copy link
Author

f0wu5u commented Jan 6, 2021

I have read the CLA Document and I hereby sign the CLA

@alex-mechler
Copy link
Contributor

Thanks for the PR @code-fi! Can you resolve the merge conflicts?

@f0wu5u
Copy link
Author

f0wu5u commented Jan 7, 2021

@alex-mechler merge conflicts resolved :)

@f0wu5u f0wu5u closed this Jan 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2021
@Expensify Expensify unlocked this conversation Jan 9, 2021
@Jag96
Copy link
Contributor

Jag96 commented Jan 9, 2021

@code-fi did you open another PR for this? Just double-checking since I don't see a new PR linked here or in the issue

@f0wu5u
Copy link
Author

f0wu5u commented Jan 9, 2021

@Jag96 no, it was closed automatically I think

@f0wu5u f0wu5u reopened this Jan 9, 2021
Copy link
Contributor

@alex-mechler alex-mechler left a comment

Choose a reason for hiding this comment

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

I think there are some style issues, but github was having issues when you last pushed. You can run the style checker locally with npm run lint

src/components/Modal.js Outdated Show resolved Hide resolved
src/libs/KeyboardShortcut/index.js Outdated Show resolved Hide resolved
src/libs/KeyboardShortcut/index.js Outdated Show resolved Hide resolved
@f0wu5u
Copy link
Author

f0wu5u commented Jan 12, 2021

@alex-mechler changes made

Copy link
Contributor

@alex-mechler alex-mechler left a comment

Choose a reason for hiding this comment

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

When pressing escape, we get an outline around an element that should not be there.
image

src/libs/KeyboardShortcut/index.js Outdated Show resolved Hide resolved
@alex-mechler
Copy link
Contributor

@code-fi pulling this out of the thread, I was able to reproduce on Mac OS (10.15.7), on both desktop and web

@Jag96
Copy link
Contributor

Jag96 commented Feb 4, 2021

Closing in favor of #1293

@Jag96 Jag96 closed this Feb 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chat / The escape key should close open modals
3 participants