feat: Add scroll listener to the nearest scrollable container and allow consumer to disable it (#3408)
* fix: Add scroll listener to the nearest scrollable container * fix * use loop instead of recursion * fix * return document * calculate nearest scrollable container in settimeout to unblock main thread * Add prop detectNearestScroll and clear timeout on unmount * disable scroll listener on excal app * update prop name to detectScroll * update docs * remove settimeout * tweak docs Co-authored-by: David Luzar <luzar.david@gmail.com> * tweak changelog Co-authored-by: David Luzar <luzar.david@gmail.com> * lint Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
@ -195,6 +195,7 @@ export interface ExcalidrawProps {
|
||||
appState: AppState,
|
||||
) => JSX.Element;
|
||||
UIOptions?: UIOptions;
|
||||
detectScroll?: boolean;
|
||||
}
|
||||
|
||||
export type SceneData = {
|
||||
@ -228,4 +229,5 @@ export type AppProps = ExcalidrawProps & {
|
||||
UIOptions: {
|
||||
canvasActions: Required<CanvasActions>;
|
||||
};
|
||||
detectScroll: boolean;
|
||||
};
|
||||
|
Reference in New Issue
Block a user