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 闪烁的 bug #6291

Closed
wants to merge 1 commit into from
Closed

修复 Ellipsis 闪烁的 bug #6291

wants to merge 1 commit into from

Conversation

KingAmo
Copy link

@KingAmo KingAmo commented Aug 7, 2023

fix #6063

前一个PR #6155 应该是错误的改动到了这一行 :(

@1587315093
Copy link
Contributor

1587315093 commented Aug 8, 2023

这个close了,有问题,有空重来一个看看吧

  1. 先看看 贡献指南
  2. 别使用 --no-verify 绕过 commit 检查
  3. 标题最好用英文,可以去翻译一下

@1587315093 1587315093 closed this Aug 8, 2023
@@ -55,7 +55,7 @@ export const Ellipsis: FC<EllipsisProps> = p => {

function calcEllipsised() {
const root = rootRef.current
if (!root) return
if (!root?.offsetParent) return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有问题

import React, { useState } from "react";
import { Ellipsis } from "antd-mobile";

const content = `图表中空间有限,文本内容无法完全显示图表中空间有限,
文本内容无法完全显示图表中空间有限,文本内容无法完全显示图表中空间有限,
文本内容无法完全显示图表中空间有限,文本内容无法完全显示图表中空间有限,
文本内容无法完全显示图表中空间有限,文本内容无法完全显示图表中空间有限,
文本内容无法完全显示`;

export default function App() {
  const [state, setState] = useState(false);
  return (
    <div className="App">
      <Ellipsis
        content={content}
        style={{ display: state ? "block" : "none" }}
      />
      <button onClick={() => setState(true)}>点击</button>
    </div>
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ellipsis] 当 Ellipsis 处于 forceRender 的 tab 中,tab 第一次变为可见时,Ellipsis 会闪烁
2 participants