Skip to content

Commit

Permalink
#4526 - In the Text-editing mode, the canvas is not moved to make the…
Browse files Browse the repository at this point in the history
… newly added sequence visible
  • Loading branch information
kostrubin authored and svvald committed Dec 31, 2024
1 parent 204ba0c commit e90ccc1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ketcher-core/src/application/editor/modes/SequenceMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ export class SequenceMode extends BaseMode {
zoom.scrollTo(firstMonomerPosition);
}

const drawnStructuresElement = document.querySelector('.drawn-structures');
const isScrollToTheBottomNeeded =
drawnStructuresElement &&
drawnStructuresElement.getBoundingClientRect().bottom >
window.innerHeight;

if (isScrollToTheBottomNeeded) {
zoom.scrollToVerticalBottom();
}

modelChanges.merge(command);

return modelChanges;
Expand Down

0 comments on commit e90ccc1

Please sign in to comment.