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

notification 支持隐藏右上角的 closeIcon #42736

Closed
jrr997 opened this issue May 30, 2023 · 10 comments
Closed

notification 支持隐藏右上角的 closeIcon #42736

jrr997 opened this issue May 30, 2023 · 10 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@jrr997
Copy link
Contributor

jrr997 commented May 30, 2023

What problem does this feature solve?

notification 目前无法隐藏右上角的 closeIcon。我在 notification 的底部自定义了按钮,希望用户点击我的按钮来交互,而不是点击右上角直接把 notification 关闭。v4 能支持一下吗。

What does the proposed API look like?

传入一个 prop 控制显隐。

@MuxinFeng
Copy link
Contributor

closeIcon 设置为 null 咋样

@jrr997
Copy link
Contributor Author

jrr997 commented May 30, 2023

closeIcon 设置为 null 咋样

没用。icon 外面还有一层 dom。即使隐藏了 icon,鼠标移到右上角时会触发外层 dom的 hover样式。

@linxianxi
Copy link
Contributor

可以先样式 display:none

@jrr997
Copy link
Contributor Author

jrr997 commented May 31, 2023

可以先样式 display:none

外面有层 Dom 有 hover 样式

@linxianxi
Copy link
Contributor

image

@jrr997
Copy link
Contributor Author

jrr997 commented May 31, 2023

image

这确实有用。我是通过 class 选择器来选中这个 dom 然后再加 display: none 的,还得加个 className 以防影响其他通知框。

@kiner-tang
Copy link
Member

@jrr997 经过讨论,我们将会提供隐藏关闭按钮的方式,具体设计和开发进展会在这边同步,可以持续关注一下

@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label May 31, 2023
@kiner-tang kiner-tang self-assigned this May 31, 2023
@MadCcc
Copy link
Member

MadCcc commented May 31, 2023

v4 不添加新 feature 了,还是先魔改一下吧

@linxianxi
Copy link
Contributor

v5 可以 closable={false},但是文档和 ts 没写,v4 写死为 false 了

@afc163
Copy link
Member

afc163 commented Jun 25, 2023

#42791

@afc163 afc163 closed this as completed Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

6 participants