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

Fix target loss in shadow DOM by storing the target element

Open jianghaotian opened this issue 8 months ago • 0 comments

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 _target property to store the target element.
  • src/index.tsx: Modified the logic to use the stored _target element if the event target is not available, and ensured the _target is updated with the current target element.

jianghaotian avatar Mar 28 '25 10:03 jianghaotian