Skip to content

fix(item): apply safe area to proper side regardless of direction - #28403

Merged
mapsandapps merged 24 commits into
mainfrom
FW-5172
Nov 2, 2023
Merged

fix(item): apply safe area to proper side regardless of direction#28403
mapsandapps merged 24 commits into
mainfrom
FW-5172

Conversation

@mapsandapps

Copy link
Copy Markdown
Contributor

Issue number: Internal


What is the current behavior?

The safe area for Item would change sides when the direction changed. e.g., if the safe area padding should be on the left, it would be on the left when the direction was LTR but would be on the right when the direction was RTL. It should always be on the left.

What is the new behavior?

  • The left safe area padding is on the left side of Item whether the direction is LTR or RTL.
  • The right safe area padding is on the right side of Item whether the direction is LTR or RTL.
  • There's now a screenshot test for left and right padding for both directions.

Note: There is a separate ticket for updating the safe area padding for ion-item-divider.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions Bot added the package: core @ionic/core package label Oct 24, 2023
@mapsandapps
mapsandapps marked this pull request as ready for review October 26, 2023 20:44
Comment thread core/src/components/item/item.scss Outdated
Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
Comment thread core/src/components/item/item.scss

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, just a couple of things I found that I wanted to bring up!

Comment thread core/src/components/item/item.scss Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might be applying the --ion-safe-area-left to the wrong element here. This might have been a problem prior to this PR but maybe we should look into it?

If you notice on the LTR test the bottom border extends the full width to the right, even though --ion-safe-area-right is set to 10px:

image

When flipped, the bottom border is not extending fully to the left edge:

image

Happy to bring this up for team discussion to see if we should make this a separate issue!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was actually a mistake with this PR, not from before. Thanks for catching it!

@Ionitron
Ionitron requested a review from liamdebeasi as a code owner October 27, 2023 21:31
@liamdebeasi

liamdebeasi commented Oct 30, 2023

Copy link
Copy Markdown
Contributor

Removing myself as a reviewer. I'm getting added as a reviewer due the screenshot changes, but I think Amanda and Brandy have this covered 😄

@liamdebeasi
liamdebeasi removed their request for review October 30, 2023 14:51

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself looks good, great work! Just some minor feedback on the test.

Comment thread core/src/components/item/test/basic/item.e2e.ts Outdated
Comment thread core/src/components/item/test/basic/item.e2e.ts Outdated
@mapsandapps
mapsandapps enabled auto-merge November 2, 2023 13:31
@mapsandapps
mapsandapps added this pull request to the merge queue Nov 2, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2023
@mapsandapps
mapsandapps added this pull request to the merge queue Nov 2, 2023
Merged via the queue into main with commit ed040b0 Nov 2, 2023
@mapsandapps
mapsandapps deleted the FW-5172 branch November 2, 2023 14:31
github-merge-queue Bot pushed a commit that referenced this pull request Nov 8, 2023
…tion (#28420)

Issue number: Internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
The safe area for Item Divider would change sides when the direction
changed. e.g., if the safe area padding should be on the left, it would
be on the left when the direction was LTR but would be on the right when
the direction was RTL. It should always be on the left.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- The left safe area padding is on the left side of an Item Divider
whether the direction is LTR or RTL.
- The right safe area padding is on the right side of an Item Divider
whether the direction is LTR or RTL.
- Updated LTR and RTL screenshots for item to include an item divider

Similar to #28403 but for Item Divider.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants