ant-design 在Safari浏览器中,Tooltip和disabled Button一起使用,mouseout的时候Tooltip没有隐藏

tzdcorbm  于 21天前  发布在  SEO
关注(0)|答案(5)|浏览(22)

Steps to reproduce

在Safari浏览器中Tooltip和disabled Button一起使用

What is expected?

mouseout的时候Tooltip隐藏

What is actually happening?

mouseout的时候Tooltip没有隐藏
| Environment | Info |
| ------------ | ------------ |
| antd | 5.14.2 |
| React | 18 |
| System | mac 14 |
| Browser | safari 16 |

vlurs2pr

vlurs2pr3#

Safari 这么玄学...

m4pnthwp

m4pnthwp4#

推测是 onPointerEvent Safari 下没有正确触发导致。

xxe27gdn

xxe27gdn5#

需要这么处理才可以

<Tooltip title="prompt text">
  <span
      className={classnames({
      [demo]: somecondition,
  })}>
    <Button
        type="link"
        disabled={somecondition}
     >
       按钮
    </Button>
  </span>
</Tooltip>

样式

.demo {
  position: relative;
  display: inline-block;

  &::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    cursor: not-allowed;
  }
}

相关问题