Skip to content

Enhancement(Esc key hide modal) #1403

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

Merged
merged 1 commit into from
Apr 29, 2020

Conversation

shakti97
Copy link
Contributor

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • is from a uniquely-named feature branch and has been rebased on top of the latest master. (If I was asked to make more changes, I have made sure to rebase onto master then too)
  • is descriptively named and links to an issue number, i.e. Fixes #123

Fixes #1312

I have 2 solution for this enhancement,

  1. add keylistener in every component (File/Folder) and then trigger close modal from those component
  2. add global listener for ESC key and close modal from there

I have taken the 2nd approach, as the first looks to add redundant code in all component.
@catarak have a look and suggest changes if any :)

@catarak
Copy link
Member

catarak commented Apr 29, 2020

Thank you!! Looks good to me. I think this is the right approach.

I think that this state (whether or not these overlays are visible) should be moved from Redux to React, and then it would make sense to put the keyboard handler in the component, but for now, this is okay.

@catarak catarak merged commit a40fcd3 into processing:master Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

esc key should hide modal box.
2 participants