mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-12 20:10:09 +02:00
feat: pass scrollConstraints via props
This commit is contained in:
@@ -366,6 +366,7 @@ const ExcalidrawAppStateContext = React.createContext<AppState>({
|
||||
height: 0,
|
||||
offsetLeft: 0,
|
||||
offsetTop: 0,
|
||||
scrollConstraints: null,
|
||||
});
|
||||
ExcalidrawAppStateContext.displayName = "ExcalidrawAppStateContext";
|
||||
|
||||
@@ -466,7 +467,9 @@ class App extends React.Component<AppProps, AppState> {
|
||||
gridModeEnabled = false,
|
||||
theme = defaultAppState.theme,
|
||||
name = defaultAppState.name,
|
||||
scrollConstraints,
|
||||
} = props;
|
||||
|
||||
this.state = {
|
||||
...defaultAppState,
|
||||
theme,
|
||||
@@ -478,6 +481,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
name,
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight,
|
||||
scrollConstraints: scrollConstraints ?? null,
|
||||
};
|
||||
|
||||
this.id = nanoid();
|
||||
@@ -1209,6 +1213,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
height: this.state.height,
|
||||
offsetTop: this.state.offsetTop,
|
||||
offsetLeft: this.state.offsetLeft,
|
||||
scrollConstraints: this.state.scrollConstraints,
|
||||
},
|
||||
null,
|
||||
),
|
||||
|
Reference in New Issue
Block a user