From 0264a1d476a86e1e0816b934657bca54ee4e4dda Mon Sep 17 00:00:00 2001 From: "Y." Date: Wed, 11 Dec 2024 16:10:55 +0800 Subject: [PATCH] fix(NoticeBar): fix abnormal scrolling (#3346) --- src/notice-bar/notice-bar.less | 6 ++++++ src/notice-bar/notice-bar.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/notice-bar/notice-bar.less b/src/notice-bar/notice-bar.less index 8f297de3c..f86485240 100644 --- a/src/notice-bar/notice-bar.less +++ b/src/notice-bar/notice-bar.less @@ -60,6 +60,7 @@ &__prefix-icon:not(:empty) { padding-right: @spacer; + width: @notice-bar-icon-font-size; } &__suffix-icon { @@ -69,6 +70,10 @@ &__prefix-icon, &__suffix-icon { font-size: @notice-bar-icon-font-size; + + &:empty { + display: none; + } } &__operation { @@ -84,6 +89,7 @@ &__suffix-icon:not(:empty) { padding-left: @spacer; + width: @notice-bar-icon-font-size; } // theme diff --git a/src/notice-bar/notice-bar.ts b/src/notice-bar/notice-bar.ts index a81b3ebc8..0655c4f40 100644 --- a/src/notice-bar/notice-bar.ts +++ b/src/notice-bar/notice-bar.ts @@ -105,7 +105,7 @@ export default class NoticeBar extends SuperComponent { .then(([nodeRect, wrapRect]) => { const { marquee } = this.properties; - if (nodeRect == null || wrapRect == null || !nodeRect.width || !wrapRect.width) { + if (nodeRect == null || wrapRect == null || !nodeRect.width || !wrapRect.width || marquee === false) { return; }