We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Popover
^2.37.0
import React, { useState } from "react"; import { Popover, Button, Empty } from "@douyinfe/semi-ui"; import { IllustrationSuccess, IllustrationSuccessDark, } from "@douyinfe/semi-illustrations"; const portalElement = () => { let portalElement = document.body.querySelector<HTMLElement>(`div#hahahaha`); if (!portalElement) { portalElement = document.body.appendChild(document.createElement("div")); portalElement.style.position = "relative"; portalElement.setAttribute("id", "hahahaha"); } return portalElement; }; const App = () => { const content = ( <Empty title={"先进的设计 / 研发协作方式"} image={<IllustrationSuccess style={{ width: 150, height: 150 }} />} darkModeImage={ <IllustrationSuccessDark style={{ width: 150, height: 150 }} /> } description="使用 Semi D2C 快速还原 Figma 设计稿,一键转代码" style={{ width: 400, margin: "0 auto", display: "flex", padding: 20, }} /> ); const [visible, setVisible] = useState(false); return ( <div style={{ width: "100%", height: "100%" }}> <h1>Hello World</h1> <div style={{ display: "flex", width: "500px", height: "500px", justifyContent: "center", alignItems: "center", }} > <Popover position="top" visible={visible} content={content} trigger="click" getPopupContainer={portalElement} > <Button onClick={() => { setVisible(true); }} > 我是按钮 </Button> </Popover> </div> </div> ); }; export default App;
- OS: Apple M1 Pro - browser: Chrome 124.0.6367.119
详情见录屏: https://github.com/DouyinFE/semi-design/assets/29619882/aeb6f958-f761-4007-b31a-868d21fdff11
The text was updated successfully, but these errors were encountered:
DaiQiangReal
No branches or pull requests
Is there an existing issue for this?
Which Component
Popover
Semi Version
^2.37.0
Current Behavior
Expected Behavior
Steps To Reproduce
2.Popover被隐藏
ReproducibleCode
Environment
Anything else?
详情见录屏:
https://github.com/DouyinFE/semi-design/assets/29619882/aeb6f958-f761-4007-b31a-868d21fdff11
The text was updated successfully, but these errors were encountered: