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

モーダル内でmousedownしてモーダル外でmouseupしたときはモーダルを閉じないように #4119

Merged
merged 3 commits into from Dec 2, 2023

Conversation

mehm8128
Copy link
Member

close #3536
discussionタグついてるけど使いにくいと感じるときがあるので直しました
考慮漏れがないかあんまり自信ないかもです

@mehm8128 mehm8128 self-assigned this Oct 27, 2023
@github-actions
Copy link

@nokhnaton
Copy link
Contributor

mouseupイベントで閉じるようにするだけでもいいのかなと思いました
正直mousedownのタイミングで閉じたいことって無いような気がしてます。
どっちかって言うと、mousedownした直後にやっぱり閉じたくないなみたいに思う時はあるので、私はmouseupイベントだけで閉じる方が嬉しいです

@mehm8128
Copy link
Member Author

それは僕も同じ意見で、この変更でもmouseupで閉じるようにして僕の環境では確認できたのですが、なっていなさそうですか?
mousedownを考えずにmouseupイベントで閉じる、だけにすると現状と同じような挙動になってしまうため、モーダル内でmousedownしたときはmouseupでemitしないような実装にしてあります

@nokhnaton
Copy link
Contributor

あ、ごめんなさい。適当にコード読んでタイトルだけ見てコメントしてました。
良さげな挙動っぽいです

@nokhnaton
Copy link
Contributor

モーダル外でmousedown->モーダル内でmosueupでモーダルが閉じるのだけが気になりました。
個人的にはこのパターンだと閉じないでほしいかなって思います

@mehm8128
Copy link
Member Author

確かに
直しました

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0ef6320) 86.35% compared to head (80e8814) 86.35%.
Report is 58 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4119   +/-   ##
=======================================
  Coverage   86.35%   86.35%           
=======================================
  Files          66       66           
  Lines        4719     4719           
  Branches      564      564           
=======================================
  Hits         4075     4075           
  Misses        638      638           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ras0q ras0q left a comment

Choose a reason for hiding this comment

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

動作確認しました、よさそうです!

@mehm8128 mehm8128 merged commit 972dd4c into master Dec 2, 2023
10 of 11 checks passed
@mehm8128 mehm8128 deleted the fix/modal_click_outside branch December 2, 2023 03:44
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.

モーダルやポップアップの外で発火したmouseupでモーダルとかが閉じる
3 participants