react-infinite-scroll-component
react-infinite-scroll-component copied to clipboard
Fix target loss in shadow DOM by storing the target element
This PR addresses part of the concerns raised in #314 .
This pull request includes changes to the InfiniteScroll component in src/index.tsx to fix an issue with target loss in the shadow DOM. The most important changes include adding a private _target property to store the target element and modifying the logic to use this stored target element if necessary.
Improvements to target handling in shadow DOM:
src/index.tsx: Added a private_targetproperty to store the target element.src/index.tsx: Modified the logic to use the stored_targetelement if the event target is not available, and ensured the_targetis updated with the current target element.