mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: pass scrollConstraints via props
This commit is contained in:
parent
381ef93956
commit
19ba107041
8 changed files with 21 additions and 6 deletions
|
@ -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,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue