fix(client): show description when above line 1

This commit is contained in:
Shaun Hamilton
2022-01-28 13:24:29 +00:00
committed by Ahmad Abdolsaheb
parent 765e72e702
commit 7d1677fc86

View File

@ -890,14 +890,14 @@ const Editor = (props: EditorProps): JSX.Element => {
// if (
// isEqual({ ..._editor.getPosition() }, { lineNumber: 1, column: 1 })
// ) {
const [top, bottom] = editableRegionBoundaries;
editor.setPosition({
lineNumber: editableRegionBoundaries[0] + 1,
lineNumber: top + 1,
column: 1
});
editor.revealLinesInCenter(
editableRegionBoundaries[0],
editableRegionBoundaries[1]
);
// To prevent descriptionWidget from being out of view
editor.revealLinesInCenter(top, top === 0 ? 1 : bottom);
// }
}