change method of fix to rounding

This commit is contained in:
Shpuld Shpuldson 2020-11-09 15:02:48 +02:00
parent fb80dbbc77
commit c1c207788a
1 changed files with 5 additions and 7 deletions

View File

@ -531,14 +531,12 @@ const PostStatusForm = {
!(isFormBiggerThanScroller && !(isFormBiggerThanScroller &&
this.$refs.textarea.selectionStart !== this.$refs.textarea.value.length) this.$refs.textarea.selectionStart !== this.$refs.textarea.value.length)
const totalDelta = shouldScrollToBottom ? bottomChangeDelta : 0 const totalDelta = shouldScrollToBottom ? bottomChangeDelta : 0
const targetScroll = currentScroll + totalDelta const targetScroll = Math.round(currentScroll + totalDelta)
if (totalDelta >= 1) { if (scrollerRef === window) {
if (scrollerRef === window) { scrollerRef.scroll(0, targetScroll)
scrollerRef.scroll(0, targetScroll) } else {
} else { scrollerRef.scrollTop = targetScroll
scrollerRef.scrollTop = targetScroll
}
} }
this.$refs['emoji-input'].resize() this.$refs['emoji-input'].resize()