From 2c092df9da3fcb33a789f8b22c2ccd913614afcf Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Mon, 13 Jan 2020 23:39:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20select=20=E5=A4=9A=E9=80=89=E6=97=B6?= =?UTF-8?q?=E7=9A=84=20padding=20(#20861)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: select 多选时的 padding * fix: RTL * remove css * fix: rtl 模式下 signle --- components/select/style/multiple.less | 15 +++++++++++++-- components/select/style/single.less | 10 +++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/components/select/style/multiple.less b/components/select/style/multiple.less index 7685fe1833..f89a7ce972 100644 --- a/components/select/style/multiple.less +++ b/components/select/style/multiple.less @@ -126,13 +126,13 @@ .@{select-prefix-cls}-selection-placeholder { position: absolute; top: 0; - left: @control-padding-horizontal; + left: @input-padding-horizontal; height: @select-height-without-border; line-height: @select-height-without-border; transition: all 0.3s; .@{select-prefix-cls}-rtl& { - right: @control-padding-horizontal; + right: @input-padding-horizontal; left: auto; } } @@ -170,4 +170,15 @@ .select-size('lg', @input-height-lg); .select-size('sm', @input-height-sm); + + // Size small need additional set padding + &.@{select-prefix-cls}-sm { + .@{select-prefix-cls}-selection-placeholder { + left: @input-padding-horizontal-sm; + + .@{select-prefix-cls}-rtl& { + right: @input-padding-horizontal-sm; + } + } + } } diff --git a/components/select/style/single.less b/components/select/style/single.less index 4a8b83ad30..9fd3ce98ac 100644 --- a/components/select/style/single.less +++ b/components/select/style/single.less @@ -58,7 +58,7 @@ padding-right: @font-size-base; .@{select-prefix-cls}-rtl& { - padding-right: @input-padding-horizontal-base; + padding-right: 0; padding-left: @font-size-base; } } @@ -157,11 +157,19 @@ // With arrow should provides `padding-right` to show the arrow &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search { right: @input-padding-horizontal-sm + @font-size-base * 1.5; + + .@{select-prefix-cls}-rtl& { + right: 0; + } } &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item, &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder { padding-right: @font-size-base * 1.5; + + .@{select-prefix-cls}-rtl& { + padding-right: 0; + } } } }