mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Revert "Don't scroll page when TTDDialog is opened"
This reverts commit 9e0558bb1a
.
This commit is contained in:
parent
9e0558bb1a
commit
c9ddf6075b
8 changed files with 15 additions and 16 deletions
|
@ -78,8 +78,8 @@
|
||||||
"autorelease": "node scripts/autorelease.js",
|
"autorelease": "node scripts/autorelease.js",
|
||||||
"prerelease:excalidraw": "node scripts/prerelease.js",
|
"prerelease:excalidraw": "node scripts/prerelease.js",
|
||||||
"release:excalidraw": "node scripts/release.js",
|
"release:excalidraw": "node scripts/release.js",
|
||||||
"rm:build": "rimraf excalidraw-app/{build,dist,dev-dist} && rimraf packages/*/{dist,build} && rimraf examples/*/{build,dist}",
|
"rm:build": "rm -rf excalidraw-app/{build,dist,dev-dist} && rm -rf packages/*/{dist,build} && rm -rf examples/*/{build,dist}",
|
||||||
"rm:node_modules": "rimraf node_modules && rimraf excalidraw-app/node_modules && rimraf packages/*/node_modules",
|
"rm:node_modules": "rm -rf node_modules && rm -rf excalidraw-app/node_modules && rm -rf packages/*/node_modules",
|
||||||
"clean-install": "yarn rm:node_modules && yarn install"
|
"clean-install": "yarn rm:node_modules && yarn install"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
||||||
"repository": "https://github.com/excalidraw/excalidraw",
|
"repository": "https://github.com/excalidraw/excalidraw",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"gen:types": "rimraf types && tsc",
|
"gen:types": "rm -rf types && tsc",
|
||||||
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
"build:esm": "rm -rf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
||||||
"repository": "https://github.com/excalidraw/excalidraw",
|
"repository": "https://github.com/excalidraw/excalidraw",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"gen:types": "rimraf types && tsc",
|
"gen:types": "rm -rf types && tsc",
|
||||||
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
"build:esm": "rm -rf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2960,8 +2960,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
this.scheduleImageRefresh();
|
this.scheduleImageRefresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
private onScroll = () => {
|
private onScroll = debounce(() => {
|
||||||
debugger;
|
|
||||||
const { offsetTop, offsetLeft } = this.getCanvasOffsets();
|
const { offsetTop, offsetLeft } = this.getCanvasOffsets();
|
||||||
this.setState((state) => {
|
this.setState((state) => {
|
||||||
if (state.offsetLeft === offsetLeft && state.offsetTop === offsetTop) {
|
if (state.offsetLeft === offsetLeft && state.offsetTop === offsetTop) {
|
||||||
|
@ -2969,7 +2968,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
}
|
}
|
||||||
return { offsetTop, offsetLeft };
|
return { offsetTop, offsetLeft };
|
||||||
});
|
});
|
||||||
};
|
}, SCROLL_TIMEOUT);
|
||||||
|
|
||||||
// Copy/paste
|
// Copy/paste
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ export const TTDDialogInput = ({
|
||||||
}
|
}
|
||||||
const textarea = ref.current;
|
const textarea = ref.current;
|
||||||
if (textarea) {
|
if (textarea) {
|
||||||
textarea.focus();
|
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
if (event[KEYS.CTRL_OR_CMD] && event.key === KEYS.ENTER) {
|
if (event[KEYS.CTRL_OR_CMD] && event.key === KEYS.ENTER) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -48,6 +47,7 @@ export const TTDDialogInput = ({
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
value={input}
|
value={input}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
|
autoFocus
|
||||||
ref={ref}
|
ref={ref}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
||||||
"homepage": "https://github.com/excalidraw/excalidraw/tree/master/packages/excalidraw",
|
"homepage": "https://github.com/excalidraw/excalidraw/tree/master/packages/excalidraw",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"gen:types": "rimraf types && tsc",
|
"gen:types": "rm -rf types && tsc",
|
||||||
"build:esm": "rimraf dist && node ../../scripts/buildPackage.js && yarn gen:types"
|
"build:esm": "rm -rf dist && node ../../scripts/buildPackage.js && yarn gen:types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
||||||
"repository": "https://github.com/excalidraw/excalidraw",
|
"repository": "https://github.com/excalidraw/excalidraw",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"gen:types": "rimraf types && tsc",
|
"gen:types": "rm -rf types && tsc",
|
||||||
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
"build:esm": "rm -rf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
||||||
"repository": "https://github.com/excalidraw/excalidraw",
|
"repository": "https://github.com/excalidraw/excalidraw",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"gen:types": "rimraf types && tsc",
|
"gen:types": "rm -rf types && tsc",
|
||||||
"build:esm": "rimraf dist && node ../../scripts/buildUtils.js && yarn gen:types"
|
"build:esm": "rm -rf dist && node ../../scripts/buildUtils.js && yarn gen:types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue