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

[hooks] useResizeObserver.ts 判断 container 是否存在有误 #2805

Closed
loganylwu opened this issue Sep 14, 2023 · 5 comments
Closed

[hooks] useResizeObserver.ts 判断 container 是否存在有误 #2805

loganylwu opened this issue Sep 14, 2023 · 5 comments

Comments

@loganylwu
Copy link
Contributor

container: Ref<HTMLElement>,

@github-actions
Copy link
Contributor

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

@loganylwu
Copy link
Contributor Author

若 container 是Ref
那么判断是否应该 if(container.value)?

if (container) {

@chaishi
Copy link
Collaborator

chaishi commented Sep 14, 2023

是的,缺了个 .value

@chaishi chaishi changed the title [hooks] 有逻辑错误 [hooks] useResizeObserver.ts 判断 container 是否存在有误 Sep 14, 2023
@chaishi
Copy link
Collaborator

chaishi commented Sep 14, 2023

Vue2 resolved in #2806
Vue3 resolved in Tencent/tdesign-vue-next#3372

@uyarn uyarn added the to be published fixed, not be published label Sep 14, 2023
@github-actions github-actions bot mentioned this issue Sep 21, 2023
16 tasks
@uyarn uyarn closed this as completed Sep 21, 2023
@chaishi chaishi removed the to be published fixed, not be published label Sep 22, 2023
@chaishi
Copy link
Collaborator

chaishi commented Sep 22, 2023

此处使用 container 判断没有问题,当前元素存在时,才会添加 observer 监听。更为 container.value 在元素默认不显示场景,无法给出正确判断,即无法添加 observer 监听

回滚 PR: Tencent/tdesign-vue-next#3411

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

3 participants