Skip to content

Commit

Permalink
fixes #304, kudos to @andpor (#2197)
Browse files Browse the repository at this point in the history
Summary:
Should fix facebookarchive/draft-js#304.
Thanks andpor.

**Summary**
based on Andrzej's facebookarchive/draft-js#1223, issue has been there for an incredible 3.5 years. Let's fix this.
Pull Request resolved: facebookarchive/draft-js#2197

Reviewed By: elboman

Differential Revision: D18314441

Pulled By: mrkev

fbshipit-source-id: 99284101bab838c574341b44b3cfcd935f1dc0e2
  • Loading branch information
crowicked authored and facebook-github-bot committed Nov 5, 2019
1 parent 1279ec0 commit ba5fc4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/component/contents/DraftEditorBlock.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ class DraftEditorBlock extends React.Component<Props> {
'blockNode is not an HTMLElement',
);
const blockBottom = blockNode.offsetHeight + blockNode.offsetTop;
const scrollBottom = scrollParent.offsetHeight + scrollPosition.y;
const pOffset = scrollParent.offsetTop + scrollParent.offsetHeight;
const scrollBottom = pOffset + scrollPosition.y;

scrollDelta = blockBottom - scrollBottom;
if (scrollDelta > 0) {
Scroll.setTop(
Expand Down

0 comments on commit ba5fc4e

Please sign in to comment.