From 458ab307652328ace71dc0523323422f7ebdbaac Mon Sep 17 00:00:00 2001 From: haoziqaq <357229046@qq.com> Date: Sun, 26 Dec 2021 00:53:43 +0800 Subject: [PATCH] fix(ui/input, select): fix placeholder animation and var--ellipsis class affects: @varlet/ui --- packages/varlet-ui/src/input/input.less | 5 +++-- packages/varlet-ui/src/select/select.less | 2 +- packages/varlet-ui/src/styles/common.less | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/varlet-ui/src/input/input.less b/packages/varlet-ui/src/input/input.less index fc37655fa92..15d1408638f 100644 --- a/packages/varlet-ui/src/input/input.less +++ b/packages/varlet-ui/src/input/input.less @@ -70,7 +70,7 @@ left: 0; width: 100%; transform-origin: left; - transition-property: top, transform; + transition-property: top, transform, width; transition-duration: 0.3s; transform: translate(0, calc(-50% + var(--input-placeholder-size) / 2)) scale(1); font-size: var(--input-placeholder-size); @@ -83,7 +83,8 @@ left: 0; width: 100%; transform-origin: left; - transition: transform 0.3s; + transition-property: transform, width; + transition-duration: 0.3s; transform: translate(0, calc(var(--input-textarea-padding-top) + var(--input-placeholder-size))) scale(1); font-size: var(--input-placeholder-size); color: var(--input-blur-color); diff --git a/packages/varlet-ui/src/select/select.less b/packages/varlet-ui/src/select/select.less index a0fc9952a3c..f2cd5895072 100644 --- a/packages/varlet-ui/src/select/select.less +++ b/packages/varlet-ui/src/select/select.less @@ -93,7 +93,7 @@ left: 0; width: 100%; transform-origin: left; - transition-property: top, transform; + transition-property: top, transform, width; transition-duration: 0.3s; transform: translate(0, calc(-50% + var(--select-placeholder-size) / 2)) scale(1); font-size: var(--select-placeholder-size); diff --git a/packages/varlet-ui/src/styles/common.less b/packages/varlet-ui/src/styles/common.less index 20d0e1d43bd..5a552120e8c 100644 --- a/packages/varlet-ui/src/styles/common.less +++ b/packages/varlet-ui/src/styles/common.less @@ -32,6 +32,7 @@ &--ellipsis { overflow-x: hidden; text-overflow: ellipsis; + white-space: nowrap; } &--inline-block {