Browse Source

fix: when Timepicker closes loop mode, scrolling to the last item animation is abnormal (#1179)

Co-authored-by: pointhalo <[email protected]>
YannLynn 3 years ago
parent
commit
7459d7297b

+ 16 - 0
packages/semi-foundation/timePicker/timePicker.scss

@@ -8,6 +8,22 @@ $module-list: #{$prefix}-scrolllist;
     &-panel {
         .#{$module-list}-body {
             height: $height-timePicker_panel_body;
+
+            .#{$module-list}-item-wheel .#{$module-list}-list-outer-nocycle,
+            .#{$module-list}-item {
+                & > ul {
+                    &:before {
+                        height: ($height-timePicker_panel_body - $height-scrollList_item) * 0.5;
+                    }
+                }
+            }
+
+            .#{$module-list}-item,
+            .#{$module-list}-item-wheel .#{$module-list}-list-outer {
+                & > ul {
+                    padding-bottom: ($height-timePicker_panel_body - $height-scrollList_item) * 0.5;
+                }
+            }
         }
 
         .#{$module-list}-item,

+ 1 - 0
packages/semi-foundation/timePicker/variables.scss

@@ -5,6 +5,7 @@ $color-timePicker_range_panel-border: rgba(0, 0, 0, .1); // 时间选择器描
 // Width/Height
 $width-timePicker_range_panel-border: 1px; // 时间选择器菜单分割线宽度
 $height-timePicker_panel_body: 252px; // 时间选择器菜单高度
+$height-scrollList_item: 36px; 
 $width-timePicker_panel_list_ampm: 72px; // 时间选择器菜单中列宽度 - 上午下午
 $width-timePicker_panel_list_hour: 64px; // 时间选择器菜单中列宽度 - 小时
 $width-timePicker_panel_list_minute: 64px; // 时间选择器菜单中列宽度 - 分钟