summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2024-01-22 16:41:55 +0100
committerOskar Nyberg <oskar@mullvad.net>2024-01-29 09:44:53 +0100
commitecbc2feb62bfa74321c39e11a032eccf33e89dd7 (patch)
treec7b282a8621416abe07bd17d1c811758c2cdd94e /gui
parent55feda8944299f9540ad43adbb39b6ac81dc5a6f (diff)
downloadmullvadvpn-ecbc2feb62bfa74321c39e11a032eccf33e89dd7.tar.xz
mullvadvpn-ecbc2feb62bfa74321c39e11a032eccf33e89dd7.zip
Fix CustomScrollbars off-by-one error
Diffstat (limited to 'gui')
-rw-r--r--gui/src/renderer/components/CustomScrollbars.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/gui/src/renderer/components/CustomScrollbars.tsx b/gui/src/renderer/components/CustomScrollbars.tsx
index 65db8c87fe..45e7ad521d 100644
--- a/gui/src/renderer/components/CustomScrollbars.tsx
+++ b/gui/src/renderer/components/CustomScrollbars.tsx
@@ -542,8 +542,9 @@ class CustomScrollbars extends React.Component<IProps, IState> {
const thumbHeight = this.computeThumbHeight(scrollable);
thumb.style.setProperty('height', thumbHeight + 'px');
- // hide thumb when there is nothing to scroll
- const canScroll = thumbHeight < scrollable.offsetHeight;
+ // hide thumb when there is nothing to scroll. We've had issues with scrollHeight being
+ // off-by-one, to ensure this doesn't happen we subtract 1 here.
+ const canScroll = thumbHeight < scrollable.offsetHeight - 1;
if (this.state.canScroll !== canScroll) {
this.setState({ canScroll });