virtual-list icon indicating copy to clipboard operation
virtual-list copied to clipboard

fix: offsetHeight null error (#259)

Open lift46252 opened this issue 1 year ago • 21 comments

remove findDOMNode and used element instead

issue to fix https://github.com/react-component/virtual-list/issues/259

lift46252 avatar Jul 03 '24 07:07 lift46252

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
virtual-list ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2024 7:11am

vercel[bot] avatar Jul 03 '24 07:07 vercel[bot]

这个问题修复了吗?在哪个版本?

yukui630 avatar Aug 28 '24 01:08 yukui630

这个问题修复了吗?在哪个版本?

没有,希望先给个复现找找问题是什么

yoyo837 avatar Aug 28 '24 01:08 yoyo837

ReactDOM.findDOMNode 不是在React 17中已经弃用了吗 image image

yukui630 avatar Aug 28 '24 07:08 yukui630

我这里是用qiankun嵌入到主应用之后,子应用所有涉及到select下拉的地方都报错

yukui630 avatar Aug 28 '24 07:08 yukui630

我把rc-util的findDOMNode修改直接返回node 也能解决这个问题,代码能否做兼容 image

yukui630 avatar Aug 28 '24 08:08 yukui630

我们希望能看看原始问题是什么,你截图的废弃方法只是一个兜底行为。

yoyo837 avatar Aug 28 '24 08:08 yoyo837

我们希望能看看原始问题是什么,你截图的废弃方法只是一个兜底行为。

这个问题我们排查出来了,复现仓库提供有点困难。出现的原因是使用了wangeditor且添加了wangeditor的公式插件@wangeditor/plugin-formula,就是这个公式插件导致的问题,并且单独打开子应用访问的时候没有报错,通过qiankun嵌入到主应用后会报错。

yukui630 avatar Aug 29 '24 07:08 yukui630

没有复现就没办法看具体原因是什么了,这个 PR 本身是不解决问题的。如果元素非有效 ele 就会导致收集高度失败而无法滚动。

zombieJ avatar Aug 29 '24 07:08 zombieJ

@zombieJ hello sorry for late reply here is a reproductable demo of our case https://stackblitz.com/edit/vitejs-vite-cguoy3?file=src%2FApp.tsx Снимок экрана от 2024-09-02 10-15-46

to work please update the iframe URL to current url of page in stackblitz (page should be opened in new tab)

video with steps https://jmp.sh/bkYSU56w

lift46252 avatar Sep 02 '24 07:09 lift46252

@zombieJ hello sorry for late reply here is a reproductable demo of our case https://stackblitz.com/edit/vitejs-vite-cguoy3?file=src%2FApp.tsx Снимок экрана от 2024-09-02 10-15-46

I don't see this error in the console

yoyo837 avatar Sep 02 '24 07:09 yoyo837

@zombieJ hello sorry for late reply here is a reproductable demo of our case https://stackblitz.com/edit/vitejs-vite-cguoy3?file=src%2FApp.tsx Снимок экрана от 2024-09-02 10-15-46

I don't see this error in the console

@yoyo837 @zombieJ i updated comment with needed steps to appear need to update iframe URL and open in new tab

lift46252 avatar Sep 02 '24 07:09 lift46252

image

yoyo837 avatar Sep 02 '24 07:09 yoyo837

image

@yoyo837 are you changed the iframe URL ? if yes try and to open in new tab image

lift46252 avatar Sep 02 '24 07:09 lift46252

@yoyo837 are you changed the iframe URL ?

Now, the new screenshots, yes, I changed it.

image

yoyo837 avatar Sep 02 '24 07:09 yoyo837

Oh, I saw it now.

yoyo837 avatar Sep 02 '24 07:09 yoyo837

Oh, I saw it now.

@yoyo837 sorry ,but can you please confirm you can reproduce the error or need to make some changes in demo ?

lift46252 avatar Sep 02 '24 07:09 lift46252

Oh, I saw it now.

@yoyo837 sorry ,but can you please confirm you can reproduce the error or need to make some changes in demo ?

Yes, The operation to reproduce the problem is more complicated, but it is much better than not being able to reproduce it.

yoyo837 avatar Sep 02 '24 07:09 yoyo837

Thanks for your reproduce. It seems rc-util isDOM function not working with iframe element check which is not rc-virtual-list bug:

ref https://github.com/react-component/util/blob/master/src/Dom/findDOMNode.ts#L4

zombieJ avatar Sep 02 '24 09:09 zombieJ

Thanks for your reproduce. It seems rc-util isDOM function not working with iframe element check which is not rc-virtual-list bug:

ref https://github.com/react-component/util/blob/master/src/Dom/findDOMNode.ts#L4

@lift46252, do you have interested to handle this?

zombieJ avatar Sep 02 '24 09:09 zombieJ

Thanks for your reproduce. It seems rc-util isDOM function not working with iframe element check which is not rc-virtual-list bug: ref https://github.com/react-component/util/blob/master/src/Dom/findDOMNode.ts#L4

@lift46252, do you have interested to handle this?

@zombieJ yes i will try but this will take some time

lift46252 avatar Sep 03 '24 05:09 lift46252