Skip to content

Commit 167c390

Browse files
author
Yang Zhen
committed
Fix md scroll
1 parent d162ffd commit 167c390

File tree

1 file changed

+3
-3
lines changed
  • app/components/Editor/components/MarkdownEditor

1 file changed

+3
-3
lines changed

app/components/Editor/components/MarkdownEditor/mdMixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ export default {
6262
}
6363
}
6464
},
65-
change: (cm, change) => {
65+
change: debounce((cm, change) => {
6666
const { editor } = this.props
6767
if (!editor.previewDOM) return
6868
const { top, clientHeight } = cm.getScrollInfo()
6969
const lineCount = cm.lineCount()
7070
const bottomLine = Math.round((top + clientHeight) / cm.defaultTextHeight()) + 1
7171
if (bottomLine >= lineCount) {
72-
debounceScroll(editor.previewDOM.parentElement, editor.previewDOM.offsetHeight)
72+
animatedScrollTo(editor.previewDOM.parentElement, editor.previewDOM.offsetHeight, 500)
7373
}
74-
}
74+
}, 500)
7575
}
7676
},
7777
componentWillMount () {},

0 commit comments

Comments
 (0)