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

tagRender in select component (in tags mode) is invoked regardless of whether values are present or not #48930

Open
momesana opened this issue May 14, 2024 · 3 comments
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@momesana
Copy link
Contributor

Reproduction link

Edit on StackBlitz

Steps to reproduce

Render a select in tags mode with a custom tagRender property which throws if value is undefined.

What is expected?

I expected tagRender only to be invoked if value is defined (i. e. a valid string)

What is actually happening?

tagRender prop is being invoked even if there is no value present (with value being set to undefined)

Environment Info
antd 5.15.2
React 18.2.0
System linux
Browser chrome

The issue was introduced with antd 5.15.2 which in turn was caused by the update of rc-select to version 14.12.1 to 14.13.0 which in turn just bumped up the version of rc-trigger from 1.5.0 to 2.0.0.

Copy link

stackblitz bot commented May 14, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@fitterfizzle
Copy link

Having the same issue

@MadCcc MadCcc added 🐛 Bug Ant Design Team had proved that this is a bug. and removed unconfirmed labels May 15, 2024
@momesana
Copy link
Contributor Author

It's this part btw, that causes the issue: https://github.com/react-component/select/blob/ebc3f689eac9640534026fb3349e901dd55bdab6/src/Selector/MultipleSelector.tsx#L179

customizeRenderSelector(undefined, content, false, false, undefined, true)

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

3 participants