Ng-zorro-antd: nzMaxTagPlaceholder is missing a class and has too much whitespace on the right side

Created on 6 Mar 2020  ·  8Comments  ·  Source: NG-ZORRO/ng-zorro-antd

Reproduction link

https://stackblitz.com/edit/angular-9xbvbe

Steps to reproduce

Select more than nzMaxTagCount items in a nz-select with nzMode="multiple".

What is expected?

The overflow/max tag (populated by nzMaxTagPlaceholder) should have the same amount of padding on both sides.

What is actually happening?

The overflow/max tag (populated by nzMaxTagPlaceholder) should have more padding on the right side.

| Environment | Info |
|---|---|
| ng-zorro-antd | 8.5.2 |
| Browser | Any |


This is a discrepancy from upstream Ant and is caused by not setting the class ant-select-selection__choice__disabled on the max tag, thus leaving room for the non-existing close X.

image

Select Tag

Most helpful comment

In NG-Zorro 9 the missing class is applied, but now there is to much whitespace on the left side instead. 😅

image

I will look at upstream and update this issue tomorrow.

All 8 comments

To clarify, manually adding ant-select-selection__choice__disabled to the tag list element fixes the problem:
image

Hello @oestrogen. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please fill the Pull Request Template here, provide documentation/test cases if needed and make sure CI passed, we will review it soon. Appreciate it advance and we are looking forward to your contribution!

你好 @oestrogen, 我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请务必填写 Pull Request 内的预设模板,提供改动所需相应的测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献!
giphy

I took a quick look, but I think the solution is a bit outside of what I can handle with my skill level. @krokofant? 😅

@oestrogen I'll take a look

@oestrogen This issue does not seem to exist in Ng Zorro 9 / master

In NG-Zorro 9 the missing class is applied, but now there is to much whitespace on the left side instead. 😅

image

I will look at upstream and update this issue tomorrow.

@vthinkxie We lost the ant-select-selection-item-content classname when customize contentTemplateOutlet for <nz-select-item>

<span class="ant-select-selection-item">
+  <span class="ant-select-selection-item-content"> + 1 </span>
-    + 1   
</span>

@oestrogen @hsuanxyz
it works as expected in v9, since you have already provided 'nzMaxTagPlaceholder' template, it would overwrite the 'ant-select-selection-item-content' classname

close now

Was this page helpful?
0 / 5 - 0 ratings