Skip to content

[Popup] Popup的显示目标位置变化时不能自动重新定位 #63

@jinzhubaofu

Description

@jinzhubaofu

如何复现:

  1. 假设,target在正常文档流,相对于body的offsetTop是500px,此时Popup已经显示出来
  2. 接下来,把target之前的内容清空,这时target的offsetTop就会变成0
  3. 这时候Popup还停留在原地

这个问题的原因在于Popup的main元素直接挂载在body上。目前使用了Popup的组件都有这个问题。

我想到了两个办法

  1. 把popup挂载到组件的main元素内部。这个方案伤筋动骨,动作太大。
  2. 给body模拟一个offsetHeightChange的事件,性能上可能有问题

大家看看有什么好办法 @wuhy @michaelliu90316

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions