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

Multiple classname string not working on nzPopoverOverlayClassName since ngZorroAntd 19 #8952

Open
lionzhong opened this issue Dec 31, 2024 · 3 comments

Comments

@lionzhong
Copy link

Reproduction link

https://stackblitz.com/edit/stackblitz-starters-uechurue?file=src%2Fmain.ts

Steps to reproduce

1、按19.0文档使用nzPopover组件,并设置[nzPopoverOverlayClassName]="'className1 className2'"这样的多样式名字符串。
2、观察运行时多样式名字符串是否已生效。

What is expected?

className1 className2都应该生效。

What is actually happening?

dom节点中className1 className2都未出现。

Environment Info
ng-zorro-antd 19.0.0
Browser Chrome v131

建议antd内部组件也应该遵循angular官方最佳实践,
请参考https://stackblitz.com/edit/stackblitz-starters-uechurue?file=src%2Fmain.ts,已经有具体的说明。

@Laffery
Copy link
Collaborator

Laffery commented Jan 1, 2025

@lionzhong 确实是这样,nz-popover 目前只支持设置单个 className,而 antd react 通过 classnames 库支持了空格分开的多个类名的字符串

https://github.com/ant-design/ant-design/blob/8164b9e30e7a7ad70d951d232387976839ce728b/components/popover/index.tsx#L47

所以我觉得确实应该支持这个特性,这个 issue 我标记为 Feature Request,并放入 19.1 milestone 中,如果有兴趣欢迎您的贡献!

@Laffery Laffery added this to the v19.1 milestone Jan 1, 2025
@lionzhong
Copy link
Author

lionzhong commented Jan 1, 2025

@lionzhong 确实是这样,nz-popover 目前只支持设置单个 className,而 antd react 通过 classnames 库支持了空格分开的多个类名的字符串

https://github.com/ant-design/ant-design/blob/8164b9e30e7a7ad70d951d232387976839ce728b/components/popover/index.tsx#L47

所以我觉得确实应该支持这个特性,这个 issue 我标记为 Feature Request,并放入 19.1 milestone 中,如果有兴趣欢迎您的贡献!

感谢回复。

其实把[class]更换为[ngClass]就可以支持上了,比较容易。

@Laffery
Copy link
Collaborator

Laffery commented Jan 2, 2025

其实把[class]更换为[ngClass]就可以支持上了,比较容易。

我们在 v19 #8895 中已经不再继续在内部组件中使用 ngClass 了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants