Skip to content

Releases: oleggrishechkin/react-viewport-list

7.1.2

07 Dec 22:27
Compare
Choose a tag to compare

Updates

  • updated configs-og and corresponding packages

Full Changelog: 7.1.1...7.1.2

7.1.1

18 Apr 20:06
Compare
Choose a tag to compare

Fixes

  • replaced clientHeight with clientWidth for 'x' axis in limits computation

Full Changelog: 7.1.0...7.1.1

7.1.0

16 Apr 20:42
Compare
Choose a tag to compare

Featues

  • Added getScrollPosition method for computing current position scroll includes index and offset.

Full Changelog: 7.0.0...7.1.0

7.0.0

10 Mar 14:02
Compare
Choose a tag to compare

This release includes a lot of features and improvements.

Breaking

  • spacerElement and spacerStyle props was removed in favour to use renderSpacer prop. You can use renderSpacer=(({ ref, style }) => (<SpacerElement ref={ref} style={{ ...style, ...spacerStyle }}>)} to achieve prevous behaviour.
  • viewportRef default value was removed. (it was document.documentElement). If you not specify viewport Ref closest scroll parent will be found automatically. You can use vewportRef={{ current: document.documentElement }} to achieve prevous behaviour
  • itemMinSize renamed to itemSize due it's not a "minimum size" since last releases.
  • margin renamed to itemMargin
  • default export was removed. Use named import instead: import { VIewportList } from 'react-viewport-list';

Featues

  • Added renderSpacer prop instead of spacerElement and spacerStyle for spacers customizations.
  • Added count property if you can't use items (usefull for skeletons)
  • Added scrollToIndex delay option to set delay for scrollToIndex
  • Added scrollToIndex prerender option to render more than one element on initial render/scrollToIndex (avoid content flushing on scrollToIndex/initial render)
  • Added automatic scroll container (viewport) detection by default if viewportRef not specified
  • Moved scroll to index logic into layoutEffect or call sync on scrolToIndex method to avoid flushing of incorrect content
  • Added indexesShift prop to support shift/unshift items. Every time you unshift (prepend items) you should increase indexesShift by prepended items count. If you shift items (remove items from top of the list you should decrease indexesShift by removed items count). (see #52)
  • Added getItemBoundingClientRect prop to support display: contents or other cases when element.getBoundingClientRect() returns "bad" data. (see #54)

Migration

  1. If you use itemMinSize or margin props just rename them to itemSize and itemMargin respectively.
  2. If you use spacerElement or spacerStyle props change them to renderSpacer prop.
  3. If you use window scroller and you not provide viewportRef you can keep it as is. ViewportList automatically detect scroll container. You can add vewportRef={{ current: document.documentElement }} to avoid detection if scroll container detection is incorrect.
  4. If you use default import you should change it to named import: import { VIewportList } from 'react-viewport-list';.

New Contributors

Full Changelog: 6.3.0...7.0.0

7.0.0-beta.0

13 Feb 18:04
Compare
Choose a tag to compare

This release includes a lot of features and improvements.

Breaking

  • spacerElement and spacerStyle props was removed in favour to use renderSpacer prop. You can use renderSpacer=(({ ref, style }) => (<SpacerElement ref={ref} style={{ ...style, ...spacerStyle }}>)} to achieve prevous behaviour.
  • viewportRef default value was removed. (it was document.documentElement). If you not specify viewport Ref closest scroll parent will be found automatically. You can use vewportRef={{ current: document.documentElement }} to achieve prevous behaviour
  • itemMinSize renamed to itemSize due it's not a "minimum size" since last releases.
  • margin renamed to itemMargin
  • default export was removed. Use named import instead: import { VIewportList } from 'react-viewport-list';

Featues

  • Added renderSpacer prop instead of spacerElement and spacerStyle for spacers customizations.
  • Added count property if you can't use items (usefull for skeletons)
  • Added scrollToIndex delay option to set delay for scrollToIndex
  • Added scrollToIndex prerender option to render more than one element on initial render/scrollToIndex (avoid content flushing on scrollToIndex/initial render)
  • Added automatic scroll container (viewport) detection by default if viewportRef not specified
  • Moved scroll to index logic into layoutEffect or call sync on scrolToIndex method to avoid flushing of incorrect content
  • Added indexesShift prop to support shift/unshift items. Every time you unshift (prepend items) you should increase indexesShift by prepended items count. If you shift items (remove items from top of the list you should decrease indexesShift by removed items count). (see #52)
  • Added getItemBoundingClientRect prop to support display: contents or other cases when element.getBoundingClientRect() returns "bad" data. (see #54)

Migration

  1. If you use itemMinSize or margin props just rename them to itemSize and itemMargin respectively.
  2. If you use spacerElement or spacerStyle props change them to renderSpacer prop.
  3. If you use window scroller and you not provide viewportRef you can keep it as is. ViewportList automatically detect scroll container. You can add vewportRef={{ current: document.documentElement }} to avoid detection if scroll container detection is incorrect.
  4. If you use default import you should change it to named import: import { VIewportList } from 'react-viewport-list';.

6.3.0

29 Dec 13:41
Compare
Choose a tag to compare

This release has several improvements for scrollToIndex. Now scoll changed by setting scrollTop/scrollLeft instead of scrollIntoView and uses setTimeout for IOS Safari

Breaking

  • Only boolean alignToTop param supported for scrollToindex. If you use scrollIntoViewOptions (see scrollIntoView) , please, change it to alignToTop. Since it's a really rare use case I included this changes to minor release instead of major.

Featues

  • scrollToIndex now uses setTimeout for IOS Safari to avoid this issue

6.2.0

04 Dec 10:35
Compare
Choose a tag to compare

What's Changed

  • Added new property 'spacerStyle' by @artsur in #44

New Contributors

Full Changelog: 6.1.0...6.2.0

6.1.0

25 Oct 16:26
Compare
Choose a tag to compare

Features

  • new scrollThreshold prop
  • new spacerElement prop

6.0.5

20 Oct 15:05
Compare
Choose a tag to compare

Fixes

  • Fix non-keyed lists (see #36)

6.0.4

03 Oct 19:25
Compare
Choose a tag to compare

Fixes

Just peerDependencies update

  • Fix react peerDependencies version to 17+.