final touches to overlayscrollbars-react 0.5.0

This commit is contained in:
Rene Haas
2022-11-16 16:08:18 +01:00
parent b77012d714
commit 97ad9b0b16
3 changed files with 4 additions and 4 deletions
@@ -4,7 +4,7 @@
### Features
Added the possibility to `defer` the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is unsupported)
Added the possibility to `defer` the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is not supported)
- `OverlayScrollbarsComponent` accepts now the `defer` property
- `useOverlayScrollbars` params accept now the `defer` key
- `useOverlayScrollbars` will now always try to destroy the instance if the component unmounts.
@@ -12,7 +12,7 @@ export type OverlayScrollbarsComponentProps<T extends keyof JSX.IntrinsicElement
options?: PartialOptions | false | null;
/** OverlayScrollbars events. */
events?: EventListeners | false | null;
/** Whether to defer the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is unsupported) */
/** Whether to defer the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is not supported) */
defer?: boolean | IdleRequestOptions;
};
@@ -16,7 +16,7 @@ export interface UseOverlayScrollbarsParams {
options?: OverlayScrollbarsComponentProps['options'];
/** OverlayScrollbars events. */
events?: OverlayScrollbarsComponentProps['events'];
/** Whether to defer the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is unsupported) */
/** Whether to defer the initialization to a point in time when the browser is idle. (or to the next frame if `window.requestIdleCallback` is not supported) */
defer?: OverlayScrollbarsComponentProps['defer'];
}
@@ -60,7 +60,7 @@ const createDefer = (): Defer => {
rafId = rAF(callback);
}
: callback,
typeof options === 'object' ? options : { timeout: 1500 }
typeof options === 'object' ? options : { timeout: 2233 }
);
},
clear,