From 1446e799c46c4528030501ce45f8024ad1bb4c48 Mon Sep 17 00:00:00 2001 From: jljsj Date: Wed, 2 Dec 2015 14:59:48 +0800 Subject: [PATCH 1/2] add select choice anim --- components/select/index.jsx | 1 + style/components/select.less | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/select/index.jsx b/components/select/index.jsx index db5d37f0ee..ff05cbc187 100644 --- a/components/select/index.jsx +++ b/components/select/index.jsx @@ -7,6 +7,7 @@ let AntSelect = React.createClass({ prefixCls: 'ant-select', transitionName: 'slide-up', optionLabelProp: 'children', + choiceTransitionName: 'zoom', showSearch: false, size: 'default' }; diff --git a/style/components/select.less b/style/components/select.less index 1ed68f85a1..25175c00a4 100644 --- a/style/components/select.less +++ b/style/components/select.less @@ -1,5 +1,7 @@ @select-prefix-cls: ant-select; +@duration: .3s; + @import "../mixins/iconfont"; //mixin .selection__clear() { @@ -243,10 +245,19 @@ border-radius: 4px; cursor: default; float: left; - padding: 0 20px 0 8px; + padding: 0 15px; margin-right: 4px; max-width: 99%; position: relative; + overflow: hidden; + transition: padding @duration @ease-in-out; + &:hover { + padding: 0 20px 0 10px; + .@{select-prefix-cls}-selection__choice__remove { + transform: scale(1); + opacity: 1; + } + } } .@{select-prefix-cls}-selection__choice__content { @@ -255,6 +266,7 @@ overflow: hidden; text-overflow: ellipsis; max-width: 100%; + transition: margin @duration @ease-in-out; } .@{select-prefix-cls}-selection__choice__remove { @@ -265,9 +277,13 @@ display: inline-block; font-weight: bold; .iconfont-size-under-12px(8px); - padding: 0 0 0 4px; position: absolute; right: 4px; + padding: 0 0 0 8px; + transform: scale(0); + opacity: 0; + transition: opacity @duration, transform @duration; + transform-origin: 50%; &:hover { color: #333; } From 4ff91a7536746041552b45c3fea3ac87ada7f463 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Dec 2015 19:27:19 +0800 Subject: [PATCH 2/2] change x size --- style/components/select.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/components/select.less b/style/components/select.less index 25175c00a4..a239e9cb4c 100644 --- a/style/components/select.less +++ b/style/components/select.less @@ -254,7 +254,7 @@ &:hover { padding: 0 20px 0 10px; .@{select-prefix-cls}-selection__choice__remove { - transform: scale(1); + transform: scale(0.75); opacity: 1; } }