From ce20d36abd9c16599104cf0e6608aed12210e274 Mon Sep 17 00:00:00 2001 From: Sendya <18x@loacg.com> Date: Thu, 16 Apr 2020 15:41:49 +0800 Subject: [PATCH] fix: vertical handle position --- components/slider/index.jsx | 3 ++- components/slider/style/index.less | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/slider/index.jsx b/components/slider/index.jsx index 734debb74b..2ab533425c 100644 --- a/components/slider/index.jsx +++ b/components/slider/index.jsx @@ -81,6 +81,7 @@ const Slider = { tooltipVisible, tooltipPlacement, getTooltipPopupContainer, + vertical, } = this.$props; const { visibles } = this; const isTipFormatter = tipFormatter ? visibles[index] || dragging : false; @@ -90,7 +91,7 @@ const Slider = { prefixCls: tooltipPrefixCls, title: tipFormatter ? tipFormatter(value) : '', visible, - placement: tooltipPlacement || 'top', + placement: tooltipPlacement || vertical ? 'right' : 'top', transitionName: 'zoom-down', overlayClassName: `${prefixCls}-tooltip`, getPopupContainer: getTooltipPopupContainer || (() => document.body), diff --git a/components/slider/style/index.less b/components/slider/style/index.less index c9f3bc9186..69954a0502 100644 --- a/components/slider/style/index.less +++ b/components/slider/style/index.less @@ -160,7 +160,7 @@ } .@{slider-prefix-cls}-handle { - margin-bottom: -7px; + margin-top: -6px; // we chould consider border width as well: (10 + 2 ) / 2 margin-left: -5px; }