From 42fed45fbc058bebf4a878672be636387dbfc78b Mon Sep 17 00:00:00 2001 From: yuanzm <1229084233@qq.com> Date: Sun, 24 Dec 2023 21:34:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E7=9A=84=E9=9A=90=E8=97=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scrollbar.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/scrollbar.ts b/src/components/scrollbar.ts index f587cfb2..263151b1 100644 --- a/src/components/scrollbar.ts +++ b/src/components/scrollbar.ts @@ -60,7 +60,9 @@ export default class ScrollBar extends View { public autoHide = true; // 滚动完毕后自动隐藏时间 - public autoHideTime = 1500; + public autoHideTime = 2000; + + public autoHideDelayTime = 1500; private autoHideRemainingTime = 0; @@ -137,7 +139,7 @@ export default class ScrollBar extends View { if (checkNeedHideScrollBar(this.direction, dimensions)) { this.hide(); - } else { + } else if (this.isHide) { this.show(); } @@ -151,6 +153,8 @@ export default class ScrollBar extends View { } else { this.style.left = scrollLeft; } + + this.autoHideRemainingTime = this.autoHideTime + this.autoHideDelayTime; } calculteScrollValue(left: number, top: number) { @@ -192,7 +196,8 @@ export default class ScrollBar extends View { } if (this.autoHide) { - this.autoHideRemainingTime = this.autoHideTime; + // this.autoHideRemainingTime = this.autoHideTime; + this.autoHideRemainingTime = this.autoHideTime + this.autoHideDelayTime; } this.style.opacity = 1;