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

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()