简体   繁体   English

材料 ui 弹出窗口中的意外行为

[英]Unexpected behavior in material ui popover

I have a lot of popvers in my page (every line in a table).我的页面中有很多弹出窗口(表格中的每一行)。 All of them work fine, the condition to opening the popover is By the id of the item.它们都可以正常工作,打开弹出框的条件是通过项目的 id。 But when i open the popover of the last item it jumps for a moment in the top-right side of the screen and then it goes to the right place.但是当我打开最后一个项目的弹出框时,它会在屏幕的右上角跳一会儿,然后转到正确的位置。 (i can sort the table by name, id etc but that problem is always happening to the last item) When i print the anchorEl it always prints the right div. (我可以按名称、ID 等对表格进行排序,但该问题总是发生在最后一项)当我打印 anchorEl 时,它总是打印正确的 div。

The material ui popover works as expected if you wrap the content in a Menu component:如果您将内容包装在 Menu 组件中,则材料 ui popover 会按预期工作:

<Popover>
    <Menu>
        <p>Content in popover here</p>
    </Menu>
</Popover>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM