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

Ellipsis 组件的 content 里面如果有 \n,不会自动换行 #6811

Closed
FruitJ opened this issue Jan 2, 2025 · 4 comments
Closed

Ellipsis 组件的 content 里面如果有 \n,不会自动换行 #6811

FruitJ opened this issue Jan 2, 2025 · 4 comments
Labels
bug need reproduce We cannot reproduce your problem

Comments

@FruitJ
Copy link

FruitJ commented Jan 2, 2025

Version of antd-mobile

5.37.1

Operating system and its version

Others

Browser and its version

Crome 版本 131.0.6778.205(正式版本) (arm64)

Sandbox to reproduce

No response

What happened?

Ellipsis 组件的 content 里面如果有 \n,不会自动换行,也不能使用 dangerouslySetInnerHTML

Relevant log output

No response

@FruitJ FruitJ added the bug label Jan 2, 2025
@zombieJ zombieJ added the need reproduce We cannot reproduce your problem label Jan 2, 2025
Copy link
Contributor

github-actions bot commented Jan 2, 2025

Hi, FruitJ.

Please provide a online reproduction so that we can help you troubleshoot the problem. You can create a demo by codesandbox or stackblitz.

我们需要你提供一个在线的重现实例,以便于我们帮你排查问题。你可以通过 codesandboxstackblitz 创建一个实例。

@FruitJ
Copy link
Author

FruitJ commented Jan 2, 2025

一下三种方法,应该可以解决上述的问题,希望可以看下优先解决下,感谢 🥹

  1. 支持 \n 换行
  2. 支持
    换行
  3. 支持 dangerouslySetInnerHTML

或者有什么解法辛苦贴一下

@FruitJ
Copy link
Author

FruitJ commented Jan 2, 2025

你好,FruitJ。

请提供在线复现,以便我们帮助您解决问题。您可以通过codesandboxstackblitz创建演示。

我们需要您提供一个在线的实例,以便我们帮助排查问题。您可以通过codesandboxstackblitz创建一个实例。

您好,我这边已经出制作了在线实例:https://codesandbox.io/p/sandbox/damp-currying-f3ntcd?workspaceId=ws_QRkxt7wGzthGexLuRHmLKr

@zombieJ
Copy link
Member

zombieJ commented Jan 6, 2025

这和 Ellipsis 没关系,你直接写 <div>{'a\nb'}</div> 也是不会换行的。需要换行要改 css:
https://codesandbox.io/p/sandbox/great-meitner-tgglt8?file=%2Fsrc%2FApp.tsx%3A17%2C9

@zombieJ zombieJ closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug need reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

2 participants