fix: Position text editor absolute and fix the offsets so it doesn't remain fixed when container is scrolled (#3200)

* fix: Position text editor absolute and fix the offsets so it doesn't remain fixed when container is scrolled

* update changelog

* Update src/packages/excalidraw/CHANGELOG.md
This commit is contained in:
Aakansha Doshi 2021-03-07 21:12:10 +05:30 committed by GitHub
parent 862c065e33
commit 3a0a638a0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View file

@ -1578,7 +1578,10 @@ class App extends React.Component<ExcalidrawProps, AppState> {
},
this.state,
);
return [viewportX, viewportY];
return [
viewportX - this.state.offsetLeft,
viewportY - this.state.offsetTop,
];
},
onChange: withBatchedUpdates((text) => {
updateElement(text);