diff --git a/src/components/App.tsx b/src/components/App.tsx index 4af09cdf5..5e8960782 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -306,7 +306,7 @@ class App extends React.Component { private scene: Scene; private resizeObserver: ResizeObserver | undefined; private nearestScrollableContainer: HTMLElement | Document | undefined; - private detectPositionChangeIntervalId: NodeJS.Timeout | undefined; + private detectPositionIntervalId: NodeJS.Timeout | undefined; constructor(props: AppProps) { super(props); @@ -791,8 +791,8 @@ class App extends React.Component { this.scene.addCallback(this.onSceneUpdated); this.addEventListeners(); - if (this.props.detectPositionChange) { - this.detectPositionChangeIntervalId = setInterval( + if (this.props.detectPosition) { + this.detectPositionIntervalId = setInterval( this.updateOffsetsIfChanged, DETECT_POSITION_CHANGE_INTERVAL, ); @@ -839,8 +839,8 @@ class App extends React.Component { this.removeEventListeners(); this.scene.destroy(); clearTimeout(touchTimeout); - if (this.detectPositionChangeIntervalId) { - clearInterval(this.detectPositionChangeIntervalId); + if (this.detectPositionIntervalId) { + clearInterval(this.detectPositionIntervalId); } touchTimeout = 0; } diff --git a/src/packages/excalidraw/index.tsx b/src/packages/excalidraw/index.tsx index 3ca3d30c6..096babc89 100644 --- a/src/packages/excalidraw/index.tsx +++ b/src/packages/excalidraw/index.tsx @@ -31,7 +31,7 @@ const Excalidraw = (props: ExcalidrawProps) => { renderCustomStats, onPaste, detectScroll = true, - detectPositionChange = false, + detectPosition = false, } = props; const canvasActions = props.UIOptions?.canvasActions; @@ -83,7 +83,7 @@ const Excalidraw = (props: ExcalidrawProps) => { UIOptions={UIOptions} onPaste={onPaste} detectScroll={detectScroll} - detectPositionChange={detectPositionChange} + detectPosition={detectPosition} /> ); diff --git a/src/types.ts b/src/types.ts index 6867489ef..6b909de03 100644 --- a/src/types.ts +++ b/src/types.ts @@ -196,7 +196,7 @@ export interface ExcalidrawProps { ) => JSX.Element; UIOptions?: UIOptions; detectScroll?: boolean; - detectPositionChange?: boolean; + detectPosition?: boolean; } export type SceneData = { @@ -231,5 +231,5 @@ export type AppProps = ExcalidrawProps & { canvasActions: Required; }; detectScroll: boolean; - detectPositionChange: boolean; + detectPosition: boolean; };