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

Button removing space when using interpolation in the children #15342

Closed
1 task
florian-bd opened this issue Mar 12, 2019 · 4 comments · Fixed by #16551
Closed
1 task

Button removing space when using interpolation in the children #15342

florian-bd opened this issue Mar 12, 2019 · 4 comments · Fixed by #16551
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it

Comments

@florian-bd
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Use JSX interpolation in Button children together with normal string

What is expected?

Space should be preserved just like when there is no interpolation

What is actually happening?

Space does not show because extra spans are created

Environment Info
antd 3.15.0
React 16.8.4
System windows
Browser Chrome
@afc163
Copy link
Member

afc163 commented Mar 12, 2019

Can you help us to fix this?

@ztplz
Copy link
Contributor

ztplz commented Mar 16, 2019

Actually this is not a bug, it is the default behavior of the span element. Whitespace at the beginning and end of a text isn't rendered. But It seems to be related to us because we used span to separate the text. @afc163 I am not sure if we need to handle this behavior.

@florian-bd
Copy link
Author

Sorry I can't help fixing this.
I use a workaround with  . I updated the codesandbox with it.
What I don't understand is why looping through the children and create a span for each? If you do that anyway then maybe join them to get a single string?

@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Apr 17, 2019
@zombieJ zombieJ assigned zombieJ and unassigned yutingzhao1991 May 13, 2019
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. 👷🏻‍♂️ Someone working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants