Releases: Norserium/react-indiana-drag-scroll
Releases · Norserium/react-indiana-drag-scroll
2.0.0
The source was rewritten in Typescript completely.
Breaking changes
Add the buttons
property
This prop is used to determine the mouse buttons that will activate the scroll on drag. The default value is [0]
, i.e. scroll on drag is activated by left mouse button only.
Remove the runtime type checking
It's recommended to use Typescript for type checking now.
Add the ScrollEvent to onScroll
, onStartScroll
, onEndScroll
params.
It's the only argument of this functions now:
{
external: boolean;
}
The external
property marks if scrolling was produced outside the container, for example, programatically.
1.7.0
Add the innerRef
property
This property is added to eliminate tedious process of getting element (especially with Typescript).
This:
const ref = useRef<ScrollContainer>();
const element = ref.current && ref.current.getElement();
<ScrollContainer ref={ref}> ... </ScrollContainer>
Can be replaced by:
const ref = useRef<HTMLElement>();
const element = ref.current;
<ScrollContainer innerRef={ref}> ... </ScrollContainer>
It's possible that in second versions the ref forwarding will be added.
Add the possibility to change the component used for the root node
Now the type of root node can be set by component
property
<ScrollContainer component="ul"> ... </ScrollContainer>
Prevent scroll container if one can't be scrolled
If scroll is not possible scroll will be blocked.