Skip to content

Commit

Permalink
feat: Slider兼容pc视口宽度改变
Browse files Browse the repository at this point in the history
  • Loading branch information
zhubeniii committed Jan 31, 2025
1 parent fa1ca89 commit 3ecb8d6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/bui-core/src/Slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ const Slider = React.forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
beforeMoveValue.current = internalValue;
tooltipRef.current = internalValue;
// 补偿获取宽度,隐藏元素getBoundingClientRect获取不到dom信息
if (!sliderRect.current.width) {
getLineWidth();
}
getLineWidth();
// currentTarget只存在于事件触发到事件处理结束之间,须在异步操作之前保存下来
const currentTarget = isMini ? e.mpEvent.currentTarget : e.currentTarget;
touchStartPageX.current = e.touches[0].pageX;
Expand Down

0 comments on commit 3ecb8d6

Please sign in to comment.