Don't sync scroll when input is not scrollable.
https://meta.discourse.org/t/composer-preview-scroll-not-syncing-with-editor/74975/14?u=tgxworld
This commit is contained in:
parent
1376a86bcc
commit
2e860eddc1
|
@ -254,8 +254,12 @@ export default Ember.Component.extend({
|
|||
|
||||
_syncEditorAndPreviewScroll($input, $preview, scrollMap) {
|
||||
let scrollTop;
|
||||
const inputHeight = $input.height();
|
||||
const inputScrollHeight = $input[0].scrollHeight;
|
||||
const inputClientHeight = $input[0].clientHeight;
|
||||
const scrollable = inputScrollHeight > inputClientHeight;
|
||||
|
||||
if (($input.height() + $input.scrollTop() + 100) > $input[0].scrollHeight) {
|
||||
if (scrollable && ((inputHeight + $input.scrollTop() + 100) > inputScrollHeight)) {
|
||||
scrollTop = $preview[0].scrollHeight;
|
||||
} else {
|
||||
const lineHeight = parseFloat($input.css('line-height'));
|
||||
|
|
Loading…
Reference in New Issue