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

[Popup] Popup组件设置popperOptions的offset属性不生效 #3184

Closed
2ue opened this issue Nov 5, 2024 · 5 comments
Closed

[Popup] Popup组件设置popperOptions的offset属性不生效 #3184

2ue opened this issue Nov 5, 2024 · 5 comments
Labels

Comments

@2ue
Copy link
Contributor

2ue commented Nov 5, 2024

tdesign-react 版本

1.9.3

重现链接

https://stackblitz.com/edit/react-f7oexg?file=src%2Fdemo.tsx

重现步骤

鼠标hover到按钮上

期望结果

期望按照设置的offset进行偏移

实际结果

使用按照设置的offset值便宜

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

github-actions bot commented Nov 5, 2024

👋 @2ue,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@ZHUBoer
Copy link

ZHUBoer commented Nov 6, 2024

https://popper.js.org/docs/v2/tutorial/#offset
image
但我根据这个配置去写,也没效果。

import React from 'react';
import { Button, Popup } from 'tdesign-react';

export default function BasicUsage() {
  return (
    <Popup
      trigger="click"
      popperOptions={{
        // offset: [-40, -100],
        name: 'offset',
        options: {
          offset: [-40, -100], // 设置偏移量
        },
      }}
      showArrow
      content="这是一个弹出框"
    >
      <Button>Hover me</Button>
    </Popup>
  );
}

@HaixingOoO
Copy link
Collaborator

image
image

@ZHUBoer 你传的值少了,测试没问题的

@uyarn
Copy link
Collaborator

uyarn commented Nov 12, 2024

@HaixingOoO 也许我们应该增加这个类似的demo

@2ue
Copy link
Contributor Author

2ue commented Nov 13, 2024

image image

@ZHUBoer 你传的值少了,测试没问题的

感谢,按照这个配置OK了

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

No branches or pull requests

4 participants