mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-22 15:20:36 +03:00
final touches to overlayscrollbars-react 0.5.0
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
### Features
|
### 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
|
- `OverlayScrollbarsComponent` accepts now the `defer` property
|
||||||
- `useOverlayScrollbars` params accept now the `defer` key
|
- `useOverlayScrollbars` params accept now the `defer` key
|
||||||
- `useOverlayScrollbars` will now always try to destroy the instance if the component unmounts.
|
- `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;
|
options?: PartialOptions | false | null;
|
||||||
/** OverlayScrollbars events. */
|
/** OverlayScrollbars events. */
|
||||||
events?: EventListeners | false | null;
|
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;
|
defer?: boolean | IdleRequestOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export interface UseOverlayScrollbarsParams {
|
|||||||
options?: OverlayScrollbarsComponentProps['options'];
|
options?: OverlayScrollbarsComponentProps['options'];
|
||||||
/** OverlayScrollbars events. */
|
/** OverlayScrollbars events. */
|
||||||
events?: OverlayScrollbarsComponentProps['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'];
|
defer?: OverlayScrollbarsComponentProps['defer'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ const createDefer = (): Defer => {
|
|||||||
rafId = rAF(callback);
|
rafId = rAF(callback);
|
||||||
}
|
}
|
||||||
: callback,
|
: callback,
|
||||||
typeof options === 'object' ? options : { timeout: 1500 }
|
typeof options === 'object' ? options : { timeout: 2233 }
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
clear,
|
clear,
|
||||||
|
|||||||
Reference in New Issue
Block a user