Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
956868d
fix(item): apply safe area to proper side regardless of direction
mapsandapps Oct 24, 2023
364c158
Lint
mapsandapps Oct 24, 2023
2947f9b
chore(): add updated snapshots
Ionitron Oct 24, 2023
62d5d03
Fix incorrect var name
mapsandapps Oct 25, 2023
3f12e7c
chore(): add updated snapshots
Ionitron Oct 25, 2023
1db5e8f
Change syntax
mapsandapps Oct 26, 2023
2dfd1c5
chore(): add updated snapshots
Ionitron Oct 26, 2023
7e6b31a
Revert screenshot changes
mapsandapps Oct 26, 2023
e651ee8
Separate padding
mapsandapps Oct 26, 2023
e15d74c
Separate padding
mapsandapps Oct 26, 2023
7852292
Update core/src/components/item/item.scss
mapsandapps Oct 27, 2023
cedd4a6
Address PR feedback
mapsandapps Oct 27, 2023
2cbe75a
Ensure that lines continue to end side
mapsandapps Oct 27, 2023
63f85ac
chore(): add updated snapshots
Ionitron Oct 27, 2023
59f1c10
Merge branch 'main' into FW-5172
mapsandapps Oct 31, 2023
f30020d
Revert erroneous snapshot changes
mapsandapps Oct 31, 2023
6dec457
Revert erroneous snapshot changes
mapsandapps Oct 31, 2023
4046742
Un-revert correct snapshot change (oops)
mapsandapps Oct 31, 2023
7fc518c
Apply suggestions from code review
mapsandapps Nov 1, 2023
3347613
chore(): add updated snapshots
Ionitron Nov 1, 2023
58186e4
Revert snapshots
mapsandapps Nov 1, 2023
943879b
Merge branch 'FW-5172' of github.com:ionic-team/ionic-framework into …
mapsandapps Nov 1, 2023
593fa4a
Revert snapshots
mapsandapps Nov 1, 2023
edcdaab
Merge branch 'main' into FW-5172
mapsandapps Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
57 changes: 39 additions & 18 deletions core/src/components/item/item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,21 @@
.item-native {
@include border-radius(var(--border-radius));
@include margin(0);
@include padding(
var(--padding-top),
var(--padding-end),
var(--padding-bottom),
calc(var(--padding-start) + var(--ion-safe-area-left, 0px))
);
@include padding(var(--padding-top), null, var(--padding-bottom));
@include text-inherit();

/* stylelint-disable */
@include ltr() {
padding-right: var(--padding-end);
padding-left: calc(var(--padding-start) + var(--ion-safe-area-left, 0px));
}

@include rtl() {
padding-right: calc(var(--padding-start) + var(--ion-safe-area-right, 0px));
padding-left: var(--padding-end);
}
/* stylelint-enable */

display: flex;
position: relative;

Expand Down Expand Up @@ -261,12 +268,19 @@ button, a {

.item-inner {
@include margin(0);
@include padding(
var(--inner-padding-top),
calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end)),
var(--inner-padding-bottom),
var(--inner-padding-start)
);
@include padding(var(--inner-padding-top), null, var(--inner-padding-bottom));

/* stylelint-disable */
@include ltr() {
padding-right: calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));
padding-left: var(--inner-padding-start);
}

@include rtl() {
padding-right: var(--inner-padding-start);
padding-left: calc(var(--ion-safe-area-left, 0px) + var(--inner-padding-end));
}
/* stylelint-enable */

display: flex;

Expand Down Expand Up @@ -295,12 +309,19 @@ button, a {

.item-bottom {
@include margin(0);
@include padding(
0,
var(--inner-padding-end),
0,
calc(var(--padding-start) + var(--ion-safe-area-left, 0px))
);
@include padding(0, null);

Comment thread
brandyscarney marked this conversation as resolved.
/* stylelint-disable */
@include ltr() {
padding-left: calc(var(--padding-start) + var(--ion-safe-area-left, 0px));
padding-right: calc(var(--inner-padding-end) + var(--ion-safe-area-right, 0px));
}

@include rtl() {
padding-left: calc(var(--inner-padding-end) + var(--ion-safe-area-left, 0px));
padding-right: calc(var(--padding-start) + var(--ion-safe-area-right, 0px));
}
/* stylelint-enable */

display: flex;

Expand Down
32 changes: 32 additions & 0 deletions core/src/components/item/test/basic/item.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,37 @@ configs().forEach(({ title, screenshot, config }) => {

await expect(page).toHaveScreenshot(screenshot(`item-diff`));
});

/**
* This behavior needs to be tested for all modes & directions
* Safe padding should stay on the same side when the direction changes
*/
test('should have safe area padding', async ({ page }) => {
await page.setContent(
`
<style>
:root {
--ion-safe-area-left: 40px;
--ion-safe-area-right: 20px;
}
</style>
<ion-list>
<ion-item>
<ion-label>Item with helper</ion-label>
<div slot="helper">Helper</div>
</ion-item>

<ion-item>
<ion-label> Single line text that should have ellipses when it doesn't all fit in the item</ion-label>
</ion-item>
</ion-list>
`,
config
);

const list = page.locator('ion-list');

await expect(list).toHaveScreenshot(screenshot('item-safe-area'));
});
});
});
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.
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.