Skip to content

Conversation

@thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Mar 28, 2023

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

End slots are lacking margin of 2px when in RTL.

Issue URL: Part of #17012

What is the new behavior?

  • Simplifying property-horizontal by removing any margin unset

End slots with buttons will have a margin-end of 2px regardless of direction.

Screenshots

Screen Shot 2023-03-24 at 13 48 25
Screen Shot 2023-03-24 at 13 48 17

Does this introduce a breaking change?

  • Yes
  • No

Other information

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions bot added the package: core @ionic/core package label Mar 28, 2023
@thetaPC thetaPC changed the title fix(property-horizontal): removal of unneeded margin unset fix(item-divider): removal of unneeded margin unset Mar 28, 2023
@thetaPC thetaPC marked this pull request as ready for review March 28, 2023 22:35
@thetaPC thetaPC requested a review from a team as a code owner March 28, 2023 22:35
@thetaPC thetaPC requested a review from liamdebeasi March 28, 2023 22:35
Base automatically changed from feature-7.0 to main March 30, 2023 16:16
@thetaPC
Copy link
Contributor Author

thetaPC commented Mar 30, 2023

Original PR #27024 was closed since this PR replaces it. The reason was due to changing base.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we revert this screenshot? Looks to be flaky

Comment on lines 23 to 29
const button = page.locator('ion-button');
const buttonMarginEnd = await button.evaluate((el) => {
const styles = window.getComputedStyle(el);
return styles.getPropertyValue('margin-end');
});

expect(buttonMarginEnd).not.toBe('0px');
Copy link
Contributor

Choose a reason for hiding this comment

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

We should avoid checking exact pixel values in favor of screenshot tests. It looks like test coverage for buttons in dividers was added in 426913d, so I'm not sure we even need this test.

<ion-item-group>
<ion-item-divider>
<ion-label>A</ion-label>
<ion-button slot="end">My Button</ion-button>
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably don't need this (and the resulting screenshot change) since this check is covered in the tests added in 426913d.

@thetaPC thetaPC requested a review from liamdebeasi April 4, 2023 18:43
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

One final thing to look at, and then we're good to go

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you able to see why the height of these screenshots are different? I wouldn't expect this to have changed, unless there's a visual diff I'm missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you able to see why the height of these screenshots are different? I wouldn't expect this to have changed, unless there's a visual diff I'm missing.

@liamdebeasi I don't know the exact reason either. My guess is that the removal of the unset is causing some minor pixel change. Since the item-fill test has a lot of components then the pixels add up. Thoughts?

Copy link
Contributor

@liamdebeasi liamdebeasi Apr 4, 2023

Choose a reason for hiding this comment

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

Ok figured it out:

Old
image

New

image

The margin is now being applied correctly which causes the text to wrap since the element itself is so narrow.

If we look at the LTR screenshot (which has always applied the margin correctly) we can see the same wrapping: https://github.com/ionic-team/ionic-framework/blob/15decdd0de7427749408f9977f6d1ab2ac969680/core/src/components/item/test/fill/item.e2e.ts-snapshots/item-fill-diff-md-ltr-Mobile-Chrome-linux.png

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, this screenshot change is correct 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woah, thank you so much!

Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

Great job!

@thetaPC thetaPC added this pull request to the merge queue Apr 4, 2023
Merged via the queue into main with commit d925237 Apr 4, 2023
@thetaPC thetaPC deleted the FW-3677-v7 branch April 4, 2023 21:33
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.

4 participants