Skip to content

Commit

Permalink
fix: 修复select-input使用valueDisplay渲染自定义tag筛选项展示居中错误 (#1503)
Browse files Browse the repository at this point in the history
* fix(tag component): 修复selectinput使用valueDisplay渲染自定义tag筛选项展示居中错误

tag组件采用display: inline-flex 布局,在selectinput使用valueDisplay渲染自定义tag筛选项时,没有父元素造成垂直居中失效

fix #1463

* chore: update snapshot

Co-authored-by: AqingCyan <aqingcyan@cyanthing.com>
Co-authored-by: Uyarn <uyarnchen@gmail.com>
  • Loading branch information
3 people authored Sep 20, 2022
1 parent 3c9d9a6 commit 8a50f86
Show file tree
Hide file tree
Showing 12 changed files with 325 additions and 159 deletions.
4 changes: 3 additions & 1 deletion src/calendar/__tests__/__snapshots__/calendar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7574,7 +7574,9 @@ exports[`cell-append.jsx 1`] = `
<span
class="t-tag t-tag--primary t-tag--dark t-tag--small t-tag--square t-size-s"
>
今天
<span>
今天
</span>
</span>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/card/__tests__/__snapshots__/card.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ exports[`footer.jsx 1`] = `
<span
class="t-tag t-tag--success t-tag--dark t-tag--medium t-tag--square"
>
默认标签
<span>
默认标签
</span>
</span>
</div>
</div>
Expand Down
40 changes: 30 additions & 10 deletions src/cascader/__tests__/__snapshots__/cascader.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ exports[`check-strictly.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
1/1.1/1.1.2/1.1.2.1
<span>
1/1.1/1.1.2/1.1.2.1
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -136,7 +138,9 @@ exports[`check-strictly.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
2
<span>
2
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -207,7 +211,9 @@ exports[`collapsed.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
选项一/子选项一
<span>
选项一/子选项一
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -225,7 +231,9 @@ exports[`collapsed.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
+2
<span>
+2
</span>
</span>
</div>
<span
Expand Down Expand Up @@ -273,7 +281,9 @@ exports[`collapsed.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
选项一/子选项一
<span>
选项一/子选项一
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -396,7 +406,9 @@ exports[`disabled.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square t-tag--disabled"
>
选项一/子选项一
<span>
选项一/子选项一
</span>
</span>
</div>
<span
Expand Down Expand Up @@ -545,7 +557,9 @@ exports[`filterable.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
当选项一数据展示文本过长时/子选项一
<span>
当选项一数据展示文本过长时/子选项一
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -824,7 +838,9 @@ exports[`multiple.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
选项一/子选项一
<span>
选项一/子选项一
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -1635,7 +1651,9 @@ exports[`value-type.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
选项一/子选项一
<span>
选项一/子选项一
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -1653,7 +1671,9 @@ exports[`value-type.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
选项一/子选项二
<span>
选项一/子选项二
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down
32 changes: 24 additions & 8 deletions src/collapse/__tests__/__snapshots__/collapse.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ exports[`base.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
Vue
<span>
Vue
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -160,7 +162,9 @@ exports[`base.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
React
<span>
React
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -497,7 +501,9 @@ exports[`icon.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
Vue
<span>
Vue
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -515,7 +521,9 @@ exports[`icon.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
React
<span>
React
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -778,7 +786,9 @@ exports[`mutex.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
Vue
<span>
Vue
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -796,7 +806,9 @@ exports[`mutex.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
React
<span>
React
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down Expand Up @@ -972,7 +984,9 @@ exports[`other.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
Vue
<span>
Vue
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand All @@ -990,7 +1004,9 @@ exports[`other.jsx 1`] = `
<span
class="t-tag t-tag--default t-tag--dark t-tag--medium t-tag--square"
>
React
<span>
React
</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
Expand Down
68 changes: 37 additions & 31 deletions src/image/__tests__/__snapshots__/image.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,23 @@ exports[`extra-always.jsx 1`] = `
class="t-tag t-tag--warning t-tag--dark t-tag--medium t-tag--mark"
style="border-radius: 3px; background: transparent; color: rgb(255, 255, 255);"
>
<svg
class="t-icon t-icon-print"
fill="none"
height="1em"
style="font-size: 16px;"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M4 2v2H3a1 1 0 00-1 1v5a1 1 0 001 1h1v3h8v-3h1a1 1 0 001-1V5a1 1 0 00-1-1h-1V2H4zm7 2H5V3h6v1zM3 5h10v5h-1V8H4v2H3V5zm2 8V9h6v4H5z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
高清
<span>
<svg
class="t-icon t-icon-print"
fill="none"
height="1em"
style="font-size: 16px;"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M4 2v2H3a1 1 0 00-1 1v5a1 1 0 001 1h1v3h8v-3h1a1 1 0 001-1V5a1 1 0 00-1-1h-1V2H4zm7 2H5V3h6v1zM3 5h10v5h-1V8H4v2H3V5zm2 8V9h6v4H5z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
高清
</span>
</span>
</div>
</div>
Expand Down Expand Up @@ -177,21 +179,23 @@ exports[`extra-always.jsx 1`] = `
class="t-tag t-tag--warning t-tag--dark t-tag--medium t-tag--mark"
style="position: absolute; right: 8px; bottom: 8px; border-radius: 3px; background: rgb(236, 242, 254); color: rgb(0, 82, 217);"
>
<svg
class="t-icon t-icon-print"
fill="none"
height="1em"
style="font-size: 16px;"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M4 2v2H3a1 1 0 00-1 1v5a1 1 0 001 1h1v3h8v-3h1a1 1 0 001-1V5a1 1 0 00-1-1h-1V2H4zm7 2H5V3h6v1zM3 5h10v5h-1V8H4v2H3V5zm2 8V9h6v4H5z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
高清
<span>
<svg
class="t-icon t-icon-print"
fill="none"
height="1em"
style="font-size: 16px;"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M4 2v2H3a1 1 0 00-1 1v5a1 1 0 001 1h1v3h8v-3h1a1 1 0 001-1V5a1 1 0 00-1-1h-1V2H4zm7 2H5V3h6v1zM3 5h10v5h-1V8H4v2H3V5zm2 8V9h6v4H5z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
高清
</span>
</span>
</div>
</div>
Expand Down Expand Up @@ -1369,7 +1373,9 @@ exports[`gallery-cover.jsx 1`] = `
class="t-tag t-tag--warning t-tag--dark t-tag--medium t-tag--mark"
style="margin: 8px; border-radius: 3px; background: rgb(236, 242, 254); color: rgb(0, 82, 217);"
>
标签一
<span>
标签一
</span>
</span>
</div>
</div>
Expand Down
Loading

0 comments on commit 8a50f86

Please sign in to comment.