From 33e3d2584a85f8ef65a52fc8ea1f19cd7cdc0eb7 Mon Sep 17 00:00:00 2001 From: solarjoker Date: Wed, 4 Nov 2020 16:32:00 +0800 Subject: [PATCH 1/4] fix: #1273 --- components/tag/TagGroup.js | 5 +++-- components/tag/TagItem.js | 18 ++++++------------ components/tag/style/index.scss | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/components/tag/TagGroup.js b/components/tag/TagGroup.js index 9a17d89ed..1a370bea0 100644 --- a/components/tag/TagGroup.js +++ b/components/tag/TagGroup.js @@ -14,6 +14,7 @@ const TagGroup = ({ editable, prefixCls = 'hi-tag-group', data, onAdd = noop, on const [editInputId, setEditInputId] = useState(-1) const [editInputValue, setEditInputValue] = useState('') const [hoverIndex, setHoverIndex] = useState(-1) + const [renderedItem] = useState(data.map((d) => d.tagId)) useEffect(() => { if (inputVisible) { @@ -107,7 +108,7 @@ const TagGroup = ({ editable, prefixCls = 'hi-tag-group', data, onAdd = noop, on onDoubleClick={onDoubleClick} isLongTag={item.isLongTag} hoverIndex={hoverIndex} - transition + transition={!renderedItem.includes(item.tagId)} onMouseEnter={(id) => setHoverIndex(id)} onMouseLeave={() => setHoverIndex(-1)} > @@ -115,7 +116,7 @@ const TagGroup = ({ editable, prefixCls = 'hi-tag-group', data, onAdd = noop, on ) }, - [hoverIndex, handleClose, onDoubleClick] + [hoverIndex, handleClose, onDoubleClick, renderedItem] ) const renderItem = useCallback( diff --git a/components/tag/TagItem.js b/components/tag/TagItem.js index c4ce5d9c2..d6bf4fa47 100644 --- a/components/tag/TagItem.js +++ b/components/tag/TagItem.js @@ -22,12 +22,13 @@ const InternalTagItem = ({ onMouseLeave = noop, hoverIndex = -1, shape = 'round', - innerRef + innerRef, + transition }) => { const [vi, setVi] = useState(false) useEffect(() => { - setVi(true) - }, []) + setVi(transition) + }, [transition]) const tagStyle = color ? { background: appearance === 'default' ? color : '', @@ -36,14 +37,7 @@ const InternalTagItem = ({ } : {} return ( - { - setTimeout(() => handleClose(id), 300) - }} - > + { - setVi(false) + handleClose(id) }} /> diff --git a/components/tag/style/index.scss b/components/tag/style/index.scss index b9f2e40d5..667232807 100644 --- a/components/tag/style/index.scss +++ b/components/tag/style/index.scss @@ -48,7 +48,7 @@ $primary: get-color($palette-primary, 'hiui-blue') !default; transition: opacity 0.3s; &:hover { - opacity: 0.65; + opacity: 0.85; } @each $key, $value in $color-map { From 31ee2e76aca4ea4eac6e861b268a7e5064fd4093 Mon Sep 17 00:00:00 2001 From: solarjoker Date: Wed, 4 Nov 2020 16:32:56 +0800 Subject: [PATCH 2/4] chore: update changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7a0c0035..1c8c7197e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ - 修复 `SelectTree` 弹出层在页面底部不能翻转问题 [#1254](https://github.com/XiaoMi/hiui/issues/1254) - 修复 `SelectTree` data 数据中 Children 为空数组报错问题 [#1261](https://github.com/XiaoMi/hiui/issues/1261) - 修复 `Tag` 使用 ref 无效问题 [#1262](https://github.com/XiaoMi/hiui/issues/1262) -- 修复 `Table` data 为 undefined 时的报错问题 [#1265](https://github.com/XiaoMi/hiui/issues/1265) -- 修复 `Loading` 显示不正确的问题 [#1265](https://github.com/XiaoMi/hiui/issues/1268) +- 修复 `Table` data 为 undefined 时的报错问题 [#1273](https://github.com/XiaoMi/hiui/issues/1265) +- 修复 `Loading` 显示不正确的问题 [#1268](https://github.com/XiaoMi/hiui/issues/1268) +- 修复 `Tag` 闪烁问题 [#1273](https://github.com/XiaoMi/hiui/issues/1273) ## 3.0.0 From 5d3a5d6aec3143d6485d6596d994216b15e80d9f Mon Sep 17 00:00:00 2001 From: solarjoker Date: Wed, 4 Nov 2020 18:20:38 +0800 Subject: [PATCH 3/4] fix: #1276 #1277 --- components/timeline/style/index.scss | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/components/timeline/style/index.scss b/components/timeline/style/index.scss index da6e1a469..08c4871af 100755 --- a/components/timeline/style/index.scss +++ b/components/timeline/style/index.scss @@ -21,6 +21,12 @@ .item__line { height: 7px !important; } + + &.timeline__item--first { + .item__line { + height: 0 !important; + } + } } &--first { @@ -204,6 +210,12 @@ height: 7px; } } + + &.timeline__item--first { + .item__line { + height: 0 !important; + } + } } &--first { @@ -304,7 +316,6 @@ .timeline__item { display: flex; position: relative; - margin-bottom: 20px; .item--left { text-align: right; @@ -360,6 +371,7 @@ .item--right { width: calc(70% - 20px); margin-left: 20px; + margin-bottom: 20px; .item__title { color: use-color('black'); @@ -383,6 +395,12 @@ .item__line { height: 7px; } + + &.timeline__item--first { + .item__line { + height: 0 !important; + } + } } &--first { From 6ae2c97ff3767ec6be5007fa60499147fdb3bdbf Mon Sep 17 00:00:00 2001 From: solarjoker Date: Wed, 4 Nov 2020 18:25:48 +0800 Subject: [PATCH 4/4] chore: update changelog --- CHANGELOG.md | 2 ++ docs/zh-CN/docs/changelog.mdx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8c7197e..4dc6e186d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ - 修复 `Table` data 为 undefined 时的报错问题 [#1273](https://github.com/XiaoMi/hiui/issues/1265) - 修复 `Loading` 显示不正确的问题 [#1268](https://github.com/XiaoMi/hiui/issues/1268) - 修复 `Tag` 闪烁问题 [#1273](https://github.com/XiaoMi/hiui/issues/1273) +- 修复 `Timeline` 折断样式问题 [#1276](https://github.com/XiaoMi/hiui/issues/1276) +- 修复 `Timeline` 只有一条数据时的样式问题 [#1277](https://github.com/XiaoMi/hiui/issues/1277) ## 3.0.0 diff --git a/docs/zh-CN/docs/changelog.mdx b/docs/zh-CN/docs/changelog.mdx index d7a0c0035..6dc8ccd65 100644 --- a/docs/zh-CN/docs/changelog.mdx +++ b/docs/zh-CN/docs/changelog.mdx @@ -11,6 +11,8 @@ - 修复 `Tag` 使用 ref 无效问题 [#1262](https://github.com/XiaoMi/hiui/issues/1262) - 修复 `Table` data 为 undefined 时的报错问题 [#1265](https://github.com/XiaoMi/hiui/issues/1265) - 修复 `Loading` 显示不正确的问题 [#1265](https://github.com/XiaoMi/hiui/issues/1268) +- 修复 `Timeline` 折断样式问题 [#1276](https://github.com/XiaoMi/hiui/issues/1276) +- 修复 `Timeline` 只有一条数据时的样式问题 [#1277](https://github.com/XiaoMi/hiui/issues/1277) ## 3.0.0