Skip to content

Commit

Permalink
fix(Header, SimpleCell): fix icons position with multiline (#8144)
Browse files Browse the repository at this point in the history
* fix(Header, SimpleCell): fix icons position with multiline

* test(SimpleCell, Header): add screenshots with long text
  • Loading branch information
EldarMuhamethanov authored Jan 15, 2025
1 parent 0c33d7d commit ae930a3
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 50 deletions.
14 changes: 11 additions & 3 deletions packages/vkui/src/components/Header/Header.e2e-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const HeaderPlayground = (props: ComponentPlaygroundProps) => {
size: ['m'],
children: ['Кто может оставлять записи на моей странице'],
afterTitle: [<Icon16UnlockOutline key="afterTitle" />],
multiline: [undefined, true],
},
{
size: ['m'],
Expand All @@ -79,7 +78,6 @@ export const HeaderPlayground = (props: ComponentPlaygroundProps) => {
children: ['Кто может оставлять записи на моей странице'],
subtitle: ['SOHN — Conrad'],
afterSubtitle: [<Icon12Fire key="afterSubtitle" />],
multiline: [undefined, true],
},
{
size: ['s', 'm', 'l', 'xl'],
Expand All @@ -90,7 +88,17 @@ export const HeaderPlayground = (props: ComponentPlaygroundProps) => {
beforeSubtitle: [<Icon12Tag key="beforeSubtitle" />],
afterSubtitle: [<Icon12Fire key="afterSubtitle" />],
subtitle: ['SOHN — Conrad'],
multiline: [undefined, true],
},
{
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',
],
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 Very long subtitle',
],
afterSubtitle: [<Icon12Fire key="afterSubtitle" />],
afterTitle: [<Icon16UnlockOutline key="afterTitle" />],
multiline: [false, true],
},
]}
>
Expand Down
1 change: 0 additions & 1 deletion packages/vkui/src/components/Header/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
.contentMultiline {
white-space: initial;
word-break: break-word;
flex-grow: 1;
}

.subtitle {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,19 @@ export const SimpleCellPlayground = (props: ComponentPlaygroundProps) => {
],
badgeBeforeTitle: [<Icon20AddCircleFillBlue key="leftBadge" />],
badgeAfterTitle: [<Icon12Verified key="rightBadge" />],
multiline: [true, false],
},
{
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 Very long children',
],
subtitle: [
'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',
],
badgeAfterTitle: [<Icon12Verified key="rightBadge" />],
badgeAfterSubtitle: [
<Icon12Fire key="iconFire" fill="var(--vkui--color_icon_negative)" />,
],
multiline: [false, true],
},
{
children: ['Title'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@
display: flex;
align-content: flex-start;
align-items: center;
justify-content: space-between;
max-inline-size: 100%;
}

.host:not(.mult) .content {
justify-content: flex-start;
}

Expand All @@ -95,7 +91,7 @@

.mult .children,
.mult .subtitle {
flex: 1 1 auto;
flex: 0 1 auto;
}

.badge {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ae930a3

Please sign in to comment.