restore scrollTop maybe ?
This commit is contained in:
parent
d03f849e3b
commit
2c1cfbc701
1 changed files with 5 additions and 0 deletions
|
@ -16,8 +16,13 @@ pt.onevent = (event, textIndex, affectedLength) => {
|
|||
if (textIndex <= start) start += affectedLength;
|
||||
if (textIndex <= end) end += affectedLength;
|
||||
|
||||
const scrollTop = textarea.scrollTop;
|
||||
// TODO: check if scrolled to bottom
|
||||
|
||||
textarea.value = pt.render()[0];
|
||||
textarea.setSelectionRange(start, end);
|
||||
|
||||
textarea.scrollTop = scrollTop;
|
||||
};
|
||||
|
||||
const socket = new WebSocket("/api/connect");
|
||||
|
|
Loading…
Reference in a new issue