Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-virtuoso

Package Overview
Dependencies
Maintainers
1
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtuoso - npm Package Compare versions

Comparing version 4.0.9 to 4.1.0

44

dist/index.d.ts
import { default as React_2 } from 'react';
export declare type CalculateViewLocation = (params: CalculateViewLocationParams) => IndexLocationWithAlign | number | null;
export declare interface CalculateViewLocationParams {
itemTop: number;
itemBottom: number;
viewportTop: number;
viewportBottom: number;
locationParams: {
align?: 'start' | 'center' | 'end';
behavior?: 'auto' | 'smooth';
} & ({
index: number;
} | {
groupIndex: number;
});
}
/**

@@ -321,3 +338,30 @@ * Customize the Virtuoso rendering by passing a set of custom components.

behavior?: 'auto' | 'smooth';
/**
* Will be called when the scroll is done, or immediately if no scroll is needed.
*/
done?: () => void;
/**
* Use this function to fine-tune the scrollIntoView behavior.
* The function receives the item's top and bottom position in the viewport, and the viewport top/bottom.
* Return an location object to scroll, or null to prevent scrolling.
* Here's the default implementation:
* ```ts
const defaultCalculateViewLocation: CalculateViewLocation = ({
itemTop,
itemBottom,
viewportTop,
viewportBottom,
locationParams: { behavior, align, ...rest },
}) => {
if (itemTop < viewportTop) {
return { ...rest, behavior, align: align ?? 'start' }
}
if (itemBottom > viewportBottom) {
return { ...rest, behavior, align: align ?? 'end' }
}
return null
}
*```
*/
calculateViewLocation?: CalculateViewLocation;
}

@@ -324,0 +368,0 @@

2

package.json

@@ -6,3 +6,3 @@ {

"sideEffects": false,
"version": "4.0.9",
"version": "4.1.0",
"homepage": "https://virtuoso.dev/",

@@ -9,0 +9,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc