react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

How to add scrollableTarget for shadowDOM element

Open parsoman opened this issue 4 years ago • 6 comments

I am trying to pass node of type HTMLDivElement in scrollableTarget but it gives this error - Uncaught TypeError: Cannot read property 'clientHeight' of null As I am using webcomponent with shadowDOM, so I can not pass id of that divElement as you would never find it using document.getElementById . So is there any way to have this scrollableTarget for shadowDom too? Any help regarding this will be appreciated.

Thanks!

parsoman avatar May 17 '21 15:05 parsoman

Maybe if you could provide the code you were working on we could figure out a way to solve it, in case you still have it

jp-olvera avatar Jul 09 '21 22:07 jp-olvera

Maybe if you could provide the code you were working on we could figure out a way to solve it, in case you still have it

here is reproduction link, thanks! https://codesandbox.io/s/angry-rhodes-9hxmg6?file=/src/index.js

luichooy avatar Jun 30 '23 12:06 luichooy

Maybe if you could provide the code you were working on we could figure out a way to solve it, in case you still have it

here is reproduction link, thanks! https://codesandbox.io/s/angry-rhodes-9hxmg6?file=/src/index.js

Hello, the code you specified will work without scrollableTarget. I have a similar problem, I can't bind it to the parent component

andrii-shpontak avatar Dec 16 '23 12:12 andrii-shpontak

Maybe if you could provide the code you were working on we could figure out a way to solve it, in case you still have it

here is reproduction link, thanks! https://codesandbox.io/s/angry-rhodes-9hxmg6?file=/src/index.js

Hello, the code you specified will work without scrollableTarget. I have a similar problem, I can't bind it to the parent component

Are you implying that I should remove the scrollableTarget="scrollableDiv" statement from <InfiniteScroll />? I just tried, but it still doesn't work properly. The fetchMoreData method doesn't get called again to load new data when i scrolled to the bottom.

luichooy avatar Dec 25 '23 08:12 luichooy

Maybe if you could provide the code you were working on we could figure out a way to solve it, in case you still have it

here is reproduction link, thanks! https://codesandbox.io/s/angry-rhodes-9hxmg6?file=/src/index.js

Hello, the code you specified will work without scrollableTarget. I have a similar problem, I can't bind it to the parent component

Are you implying that I should remove the scrollableTarget="scrollableDiv" statement from <InfiniteScroll />? I just tried, but it still doesn't work properly. The fetchMoreData method doesn't get called again to load new data when i scrolled to the bottom.

I was looking for a solution to this problem for a long time, but it was trivial, I just didn’t get attached to it, you need to look for an element on which you have a height and scrolling works and put a target to it ;)

andrii-shpontak avatar Jan 02 '24 08:01 andrii-shpontak