mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: Rename prop scrollToCenter and setScrollToCenter to scrollToContent and setScrollToContent respectively (#3261)
* refactor: Rename prop scrollToCenter and setScrollToCenter to scrollToContent and setScrollToContent respectively * fix * update changelog/readme * fix
This commit is contained in:
parent
e90e56452f
commit
052b73d95b
7 changed files with 16 additions and 14 deletions
|
@ -259,7 +259,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
|
|||
if (elements) {
|
||||
scenePromise.resolve({
|
||||
elements,
|
||||
scrollToCenter: true,
|
||||
scrollToContent: true,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -313,7 +313,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
|
|||
// noop if already resolved via init from firebase
|
||||
scenePromise.resolve({
|
||||
elements: reconciledElements,
|
||||
scrollToCenter: true,
|
||||
scrollToContent: true,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
@ -454,7 +454,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
|
|||
}: { init?: boolean; initFromSnapshot?: boolean } = {},
|
||||
) => {
|
||||
if (init || initFromSnapshot) {
|
||||
this.excalidrawAPI.setScrollToCenter(elements);
|
||||
this.excalidrawAPI.setScrollToContent(elements);
|
||||
}
|
||||
|
||||
this.excalidrawAPI.updateScene({
|
||||
|
|
|
@ -77,7 +77,7 @@ const initializeScene = async (opts: {
|
|||
|
||||
const initialData = importFromLocalStorage();
|
||||
|
||||
let scene: DataState & { scrollToCenter?: boolean } = await loadScene(
|
||||
let scene: DataState & { scrollToContent?: boolean } = await loadScene(
|
||||
null,
|
||||
null,
|
||||
initialData,
|
||||
|
@ -104,7 +104,7 @@ const initializeScene = async (opts: {
|
|||
initialData,
|
||||
);
|
||||
}
|
||||
scene.scrollToCenter = true;
|
||||
scene.scrollToContent = true;
|
||||
if (!roomLinkData) {
|
||||
window.history.replaceState({}, APP_NAME, window.location.origin);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue