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: should be closed when press esc after click portal #273

Merged
merged 3 commits into from
Aug 1, 2023

Conversation

linxianxi
Copy link
Contributor

@linxianxi linxianxi commented Aug 1, 2023

fix ant-design/ant-design#43912

没点击 Portal 时,按下 esc 有效,因为是走的 rc-dialog 的 onClose(绑在 div 上),点击 Portal 后就无效了。于是给 Portal 单独绑定 esc

@vercel
Copy link

vercel bot commented Aug 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2023 1:51am

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #273 (4198df2) into master (3931701) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head 4198df2 differs from pull request most recent head 4d28332. Consider uploading reports for the commit 4d28332 to get more accurate results

@@            Coverage Diff             @@
##           master     #273      +/-   ##
==========================================
+ Coverage   97.86%   97.90%   +0.04%     
==========================================
  Files          13       13              
  Lines         374      382       +8     
  Branches      106      108       +2     
==========================================
+ Hits          366      374       +8     
  Misses          7        7              
  Partials        1        1              
Files Changed Coverage Δ
src/Operations.tsx 96.77% <100.00%> (+1.12%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zombieJ zombieJ merged commit c4d0cf3 into react-component:master Aug 1, 2023
6 checks passed
return () => {
window.removeEventListener('keydown', onKeyDown);
};
}, [visible]);
Copy link
Member

Choose a reason for hiding this comment

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

这个会不会整个声明周期绑定、解绑一次好一点?

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.

Image组件预览时,点击任意按钮后Esc键无法退出预览
3 participants