Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Fix Bug 304 - Editor scrolls to bottom when pressing enter in the mid… #1223

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/component/contents/DraftEditorBlock.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ class DraftEditorBlock extends React.Component<Props> {
blockNode instanceof HTMLElement,
'blockNode is not an HTMLElement',
);
const blockBottom = blockNode.offsetHeight + blockNode.offsetTop;
const scrollBottom = scrollParent.offsetHeight + scrollPosition.y;
var blockBottom = blockNode.offsetHeight + blockNode.offsetTop;
var pOffset = scrollParent.offsetTop + scrollParent.offsetHeight;
var scrollBottom = pOffset + scrollPosition.y;
andpor marked this conversation as resolved.
Show resolved Hide resolved
scrollDelta = blockBottom - scrollBottom;
if (scrollDelta > 0) {
Scroll.setTop(
Expand Down