From 2cacfe78ea68ab5f83671331e5100536dca03b2d Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 16 Jul 2018 19:47:28 +0800 Subject: [PATCH] Fix switch overflow in certain situation, close #9928 --- components/switch/style/index.less | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/components/switch/style/index.less b/components/switch/style/index.less index a369799c4e..18652e48ff 100644 --- a/components/switch/style/index.less +++ b/components/switch/style/index.less @@ -104,23 +104,16 @@ } &-small&-checked { - &:before, - &:after { + &:before { left: 100%; margin-left: @switch-sm-checked-margin-left; } - .@{switch-prefix-cls}-inner { margin-left: 3px; margin-right: 18px; } } - &-small:active&-checked:before, - &-small:active&-checked:after { - margin-left: -16.5px; - } - &-small&-loading:before { animation: AntSwitchSmallLoadingCircle 1s infinite linear; font-weight: bold; @@ -134,15 +127,15 @@ margin-right: 24px; } - &:before, - &:after { + &:before { left: 100%; margin-left: -19px; } - &:active:before, - &:active:after { - margin-left: -25px; + &:after { + left: 100%; + transform: translateX(-100%); + margin-left: -1px; } }