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

Implement the function to close modal with ESC key #174

Conversation

sachin21
Copy link
Contributor

@sachin21 sachin21 commented Oct 29, 2018

Close #173

What:

画像のプレビュー機能をESCキーで閉じる機能を実装します。。

Why:
人類はESCで閉じる習慣があると思うので、ESCで閉じれないのは多少の不便を感じていました。

How:
windowkeydown eventをlistenさせ、27番(ESC)が押されたら画像のプレビューを閉じます

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Electron appでkeydownをlistenするbest practiceを知らないので、そこらへん含みレビュー頂きたいですー 🙏

@sachin21 sachin21 changed the title Implement the function to close modal with ESC Implement the function to close modal with ESC key Oct 30, 2018
@sachin21 sachin21 force-pushed the implement_the_function_to_close_modal_with_esc branch from ce06fa2 to e209af7 Compare October 30, 2018 07:32
@sachin21
Copy link
Contributor Author

sachin21 commented Nov 1, 2018

@akameco レビューお願いします 🙏

}

componentDidMount() {
window.addEventListener('keydown', this.escToClose.bind(this), false)
Copy link
Owner

Choose a reason for hiding this comment

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

ここの .bind(this) は必要ですか?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

お、不要だったら修正pull-req送ります!みますー 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

あ、すみません!修正してくださったんですね、ありがとうございます。

@akameco
Copy link
Owner

akameco commented Nov 1, 2018

@sachin21 PRありがとうございます! 一つ確認してもらえれば 🙏

@akameco akameco merged commit e209af7 into akameco:master Nov 1, 2018
@sachin21 sachin21 deleted the implement_the_function_to_close_modal_with_esc branch November 1, 2018 16:09
@akameco
Copy link
Owner

akameco commented Nov 1, 2018

v1.1.0 としてリリースしました 🎉 次の起動時に自動更新されるはずです

@sachin21
Copy link
Contributor Author

sachin21 commented Nov 5, 2018

ありがとうございますー!

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.

[feature implement] ESCでmodalを閉じる
2 participants