Skip to content

Commit 846add3

Browse files
EldarMuhamethanovactions-user
authored andcommitted
fix(Header, SimpleCell): fix icons position with multiline (#8144)
* fix(Header, SimpleCell): fix icons position with multiline * test(SimpleCell, Header): add screenshots with long text
1 parent 7a22bfc commit 846add3

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

packages/vkui/src/components/Header/Header.e2e-playground.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const HeaderPlayground = (props: ComponentPlaygroundProps) => {
6666
size: ['m'],
6767
children: ['Кто может оставлять записи на моей странице'],
6868
afterTitle: [<Icon16UnlockOutline key="afterTitle" />],
69-
multiline: [undefined, true],
7069
},
7170
{
7271
size: ['m'],
@@ -79,7 +78,6 @@ export const HeaderPlayground = (props: ComponentPlaygroundProps) => {
7978
children: ['Кто может оставлять записи на моей странице'],
8079
subtitle: ['SOHN — Conrad'],
8180
afterSubtitle: [<Icon12Fire key="afterSubtitle" />],
82-
multiline: [undefined, true],
8381
},
8482
{
8583
size: ['s', 'm', 'l', 'xl'],
@@ -90,7 +88,17 @@ export const HeaderPlayground = (props: ComponentPlaygroundProps) => {
9088
beforeSubtitle: [<Icon12Tag key="beforeSubtitle" />],
9189
afterSubtitle: [<Icon12Fire key="afterSubtitle" />],
9290
subtitle: ['SOHN — Conrad'],
93-
multiline: [undefined, true],
91+
},
92+
{
93+
children: [
94+
'Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children',
95+
],
96+
subtitle: [
97+
'Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle',
98+
],
99+
afterSubtitle: [<Icon12Fire key="afterSubtitle" />],
100+
afterTitle: [<Icon16UnlockOutline key="afterTitle" />],
101+
multiline: [false, true],
94102
},
95103
]}
96104
>

packages/vkui/src/components/Header/Header.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
.contentMultiline {
6868
white-space: initial;
6969
word-break: break-word;
70-
flex-grow: 1;
7170
}
7271

7372
.subtitle {

packages/vkui/src/components/SimpleCell/SimpleCell.e2e-playground.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ export const SimpleCellPlayground = (props: ComponentPlaygroundProps) => {
7979
],
8080
badgeBeforeTitle: [<Icon20AddCircleFillBlue key="leftBadge" />],
8181
badgeAfterTitle: [<Icon12Verified key="rightBadge" />],
82-
multiline: [true, false],
82+
},
83+
{
84+
children: [
85+
'Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children Very long children',
86+
],
87+
subtitle: [
88+
'Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long children Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle Very long subtitle',
89+
],
90+
badgeAfterTitle: [<Icon12Verified key="rightBadge" />],
91+
badgeAfterSubtitle: [
92+
<Icon12Fire key="iconFire" fill="var(--vkui--color_icon_negative)" />,
93+
],
94+
multiline: [false, true],
8395
},
8496
{
8597
children: ['Title'],

packages/vkui/src/components/SimpleCell/SimpleCell.module.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@
7878
display: flex;
7979
align-content: flex-start;
8080
align-items: center;
81-
justify-content: space-between;
8281
max-inline-size: 100%;
83-
}
84-
85-
.host:not(.mult) .content {
8682
justify-content: flex-start;
8783
}
8884

@@ -95,7 +91,7 @@
9591

9692
.mult .children,
9793
.mult .subtitle {
98-
flex: 1 1 auto;
94+
flex: 0 1 auto;
9995
}
10096

10197
.badge {

0 commit comments

Comments
 (0)