mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-20 14:17:29 -04:00
fix: Fix the scroll position of request body [INS-1105] (#8962)
This commit is contained in:
@@ -306,8 +306,13 @@ export const CodeEditor = memo(
|
||||
// NOTE: maybe we don't need this anymore? Maybe not.
|
||||
const persistState = useCallback(() => {
|
||||
if (uniquenessKey && codeMirror.current) {
|
||||
const scrollInfo = codeMirror.current.getScrollInfo();
|
||||
// ignore invalid scroll positions
|
||||
if (scrollInfo.height <= 0 || scrollInfo.width <= 0) {
|
||||
return;
|
||||
}
|
||||
editorStates[uniquenessKey] = {
|
||||
scroll: codeMirror.current.getScrollInfo(),
|
||||
scroll: scrollInfo,
|
||||
selections: codeMirror.current.listSelections(),
|
||||
cursor: codeMirror.current.getCursor(),
|
||||
history: codeMirror.current.getHistory(),
|
||||
|
||||
Reference in New Issue
Block a user