mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-17 06:29:40 +03:00
final touches to overlayscrollbars-react 0.5.0
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user