Skip to content

v0.1.1 web prepend fix

Latest

Choose a tag to compare

@theRizwan theRizwan released this 19 Aug 12:18
· 1 commit to main since this release

Fixes web prepending, which was broken in 0.1.0.

If you are using this on react-native-web, upgrade. In 0.1.0 the layout maths was correct but the component never wrote the corrected offset back to the scroll view, so inserting older items at the top jumped the list by the full height of the inserted content. On native the platform hides this because maintainVisibleContentPosition does the correction itself. On react-native-web nothing does, and react-native-web does not implement that prop at all.

  • The correction is now applied on web only, since doing it on both platforms would compensate twice
  • clone() carries the reordering flag, because a clone inherits the chunk order and hung the same way
  • The package now ships compiled output, so bundlers that only treat .jsx as JSX can build it. 0.1.0 shipped JSX inside .js files and failed under Vite

Verified in a browser: 1000 rows of varying height with a deliberately wrong estimate, scrolled into the middle, then prepended 200 rows four times to 2000. A probe read the real getBoundingClientRect().top of a tracked row before and after each prepend. Every round the scroll position was adjusted by exactly the amount the content grew and the tracked row held position to the pixel.