From 553155fc490d289242a0e57efab8de2834278959 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 9 Nov 2020 14:42:16 +0200 Subject: [PATCH 1/3] prevent call to scroll if the value doesn't change because firefox is stupid --- src/components/post_status_form/post_status_form.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index de583269..6a4efc2c 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -533,10 +533,12 @@ const PostStatusForm = { const totalDelta = shouldScrollToBottom ? bottomChangeDelta : 0 const targetScroll = currentScroll + totalDelta - if (scrollerRef === window) { - scrollerRef.scroll(0, targetScroll) - } else { - scrollerRef.scrollTop = targetScroll + if (totalDelta >= 1) { + if (scrollerRef === window) { + scrollerRef.scroll(0, targetScroll) + } else { + scrollerRef.scrollTop = targetScroll + } } this.$refs['emoji-input'].resize() From fb80dbbc77f25cdae818994a6d4828fa0d237504 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 9 Nov 2020 14:47:42 +0200 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bf8fa84..8f14bc59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### Fixed - Fixed regression in react popup alignment and overflowing +- Fixed the occasional bug where screen would scroll 1px when typing into a reply form ## [2.2.0] - 2020-11-06 From c1c207788a3599602888a9c5cadedd99561266af Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 9 Nov 2020 15:02:48 +0200 Subject: [PATCH 3/3] change method of fix to rounding --- src/components/post_status_form/post_status_form.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 6a4efc2c..3ff4a3c8 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -531,14 +531,12 @@ const PostStatusForm = { !(isFormBiggerThanScroller && this.$refs.textarea.selectionStart !== this.$refs.textarea.value.length) const totalDelta = shouldScrollToBottom ? bottomChangeDelta : 0 - const targetScroll = currentScroll + totalDelta + const targetScroll = Math.round(currentScroll + totalDelta) - if (totalDelta >= 1) { - if (scrollerRef === window) { - scrollerRef.scroll(0, targetScroll) - } else { - scrollerRef.scrollTop = targetScroll - } + if (scrollerRef === window) { + scrollerRef.scroll(0, targetScroll) + } else { + scrollerRef.scrollTop = targetScroll } this.$refs['emoji-input'].resize()