Releases: oleggrishechkin/react-viewport-list
Releases Β· oleggrishechkin/react-viewport-list
7.1.2
7.1.1
Fixes
- replaced
clientHeight
withclientWidth
for 'x' axis in limits computation
Full Changelog: 7.1.0...7.1.1
7.1.0
Featues
- Added
getScrollPosition
method for computing current position scroll includesindex
andoffset
.
Full Changelog: 7.0.0...7.1.0
7.0.0
This release includes a lot of features and improvements.
Breaking
spacerElement
andspacerStyle
props was removed in favour to userenderSpacer
prop. You can userenderSpacer=(({ ref, style }) => (<SpacerElement ref={ref} style={{ ...style, ...spacerStyle }}>)}
to achieve prevous behaviour.viewportRef
default value was removed. (it was document.documentElement). If you not specifyviewport Ref
closest scroll parent will be found automatically. You can usevewportRef={{ current: document.documentElement }}
to achieve prevous behaviouritemMinSize
renamed toitemSize
due it's not a "minimum size" since last releases.margin
renamed toitemMargin
- 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 supportdisplay: contents
or other cases whenelement.getBoundingClientRect()
returns "bad" data. (see #54)
Migration
- If you use
itemMinSize
ormargin
props just rename them toitemSize
anditemMargin
respectively. - If you use
spacerElement
orspacerStyle
props change them torenderSpacer
prop. - If you use window scroller and you not provide
viewportRef
you can keep it as is. ViewportList automatically detect scroll container. You can addvewportRef={{ current: document.documentElement }}
to avoid detection if scroll container detection is incorrect. - 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
This release includes a lot of features and improvements.
Breaking
spacerElement
andspacerStyle
props was removed in favour to userenderSpacer
prop. You can userenderSpacer=(({ ref, style }) => (<SpacerElement ref={ref} style={{ ...style, ...spacerStyle }}>)}
to achieve prevous behaviour.viewportRef
default value was removed. (it was document.documentElement). If you not specifyviewport Ref
closest scroll parent will be found automatically. You can usevewportRef={{ current: document.documentElement }}
to achieve prevous behaviouritemMinSize
renamed toitemSize
due it's not a "minimum size" since last releases.margin
renamed toitemMargin
- 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 supportdisplay: contents
or other cases whenelement.getBoundingClientRect()
returns "bad" data. (see #54)
Migration
- If you use
itemMinSize
ormargin
props just rename them toitemSize
anditemMargin
respectively. - If you use
spacerElement
orspacerStyle
props change them torenderSpacer
prop. - If you use window scroller and you not provide
viewportRef
you can keep it as is. ViewportList automatically detect scroll container. You can addvewportRef={{ current: document.documentElement }}
to avoid detection if scroll container detection is incorrect. - If you use default import you should change it to named import:
import { VIewportList } from 'react-viewport-list';
.
6.3.0
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 toalignToTop
. 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
6.1.0
Features
- new scrollThreshold prop
- new spacerElement prop
6.0.5
6.0.4
Fixes
Just peerDependencies update
- Fix react peerDependencies version to 17+.