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

Typography: Editable icon not shown on dynamical update #48378

Closed
la99er opened this issue Apr 10, 2024 · 3 comments
Closed

Typography: Editable icon not shown on dynamical update #48378

la99er opened this issue Apr 10, 2024 · 3 comments

Comments

@la99er
Copy link

la99er commented Apr 10, 2024

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Use the Typography component and add an editable object to it.
  2. Make the icon of the editable object be different, when something changes.

What is expected?

The Icon should switch or disappear, depending on what you provide as icon.

What is actually happening?

The icon never switches/shows up.

Environment Info
antd 5.16.1
React 18.x
System Linux
Browser Firefox 124.0.1

When I wrap the children of the Typography component into a span element for example, everything seems to work.
In "/components/typography/Base/index.tsx" in line 400, I see that the icon is wrapped by a Tooltip. So maybe the Tooltip component has an issue with changing children on the fly or something like that. Also, this only happens, when the children is a primitive type. As soon as I change it to a more complex type, it seems to work as well. For example

<Typography {...}>
  {test}
</Typography>

When test is a string for example, the issue is happening.

<Typography {...}>
  abc{test}
</Typography>
The issue is not happening.

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
@crazyair
Copy link
Member

First, try changing the children to avoid the issue, which is already being fixed

@crazyair
Copy link
Member

#48350

@la99er
Copy link
Author

la99er commented Apr 10, 2024

Thanks for the hint! I didn't look for closed tickets 🙈 My bad

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