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

尽可能使用ResizeObserver,而不是element-resize-detector #2329

Open
foxii-cn opened this issue Mar 4, 2024 · 1 comment
Open

尽可能使用ResizeObserver,而不是element-resize-detector #2329

foxii-cn opened this issue Mar 4, 2024 · 1 comment

Comments

@foxii-cn
Copy link

foxii-cn commented Mar 4, 2024

问题描述

在使用vue3的teleport动态改变map元素在dom树中的位置时,发现这种情况下如果传送前后父容器大小不一样,地图resize事件不会被触发

试了一下似乎是element-resize-detector的问题,使用ResizeObserver可以正常获得元素大小

另一方面,主流浏览器基本都已经支持ResizeObserver,能否在ResizeObserver可用的情况下优先使用ResizeObserver?

重现链接

No response

重现步骤

不需要

预期行为

在ResizeObserver可用的情况下优先使用ResizeObserver获得map container的大小

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

image

补充说明(可选)

No response

@lzxue
Copy link
Contributor

lzxue commented Mar 4, 2024

ResizeObserver 目前 IE 11 不支持,可以考虑默认 ResizeObserver,IE 兼容时间使用插件

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

No branches or pull requests

2 participants