Skip to content

Commit 61d266a

Browse files
committed
fix(noticebar): first item is not visible when scrolling vertically
1 parent 2be2459 commit 61d266a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/packages/noticebar/noticebar.taro.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export const NoticeBar: FunctionComponent<
358358
target.style.transitionDuration = `${
359359
swiperRef.current.moving ? 0 : duration
360360
}ms`
361-
target.style.height = `${Number(height) * childCount}px`
361+
target.style.height = `${Number(height) * (childCount + 1)}px`
362362
target.style.transform = `translate3D(0,${_offset}px,0)`
363363
}
364364
// 无缝滚动第一个元素位移控制

src/packages/noticebar/noticebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export const NoticeBar: FunctionComponent<
353353
target.style.transitionDuration = `${
354354
swiperRef.current.moving ? 0 : duration
355355
}ms`
356-
target.style.height = `${Number(height) * childCount}px`
356+
target.style.height = `${Number(height) * (childCount + 1)}px`
357357
target.style.transform = `translate3D(0,${_offset}px,0)`
358358
}
359359
// 无缝滚动第一个元素位移控制

0 commit comments

Comments
 (0)