-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(list): inset lists render correctly #26586
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run & review this pull request in StackBlitz Codeflow. |
liamdebeasi
changed the title
fix(list): inset border is correct on ios
fix(list): inset border is correct width on ios
Jan 10, 2023
liamdebeasi
changed the title
fix(list): inset border is correct width on ios
fix(list): inset border is correct on ios
Jan 10, 2023
liamdebeasi
changed the title
fix(list): inset border is correct on ios
fix(list): inset lists render correctly
Jan 10, 2023
liamdebeasi
commented
Jan 10, 2023
This comment was marked as off-topic.
This comment was marked as off-topic.
averyjohnston
approved these changes
Jan 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue URL: resolves #20819
iOS
During a design review, Ben noted that the border width on inset lists in iOS was too thick. The list component was overriding the item border width to be 1px (item sets the width to 0.55px on iOS)
Upon further investigation, it was noted that the
lines
property was never being respected wheninset="true"
. As a result, it was impossible to get inset item lines using the inset list feature. Lines should be inset by default on iOS.MD
During a design review, it was noticed that the padding on inset lists that contain interactive ion-items was incorrect. Fixing this issue revealed another bug where full lines were not being removed from items when
lines="inset"
was set onion-list
.What is the new behavior?
Architecture Note:
I decided to change the architecture of how list applies these styles for a couple reasons:
.list-md-lines-inset .item, .list-md .item-lines-inset
is not the most "readable" selector.ion-item
. For example: https://github.com/ionic-team/ionic-framework/pull/26586/files#diff-7dc0bcee862e87a0457c625c8ac1487390b4d3d9a39c667e01485537255c1cb2L67-L83These lines made it so developers could set the
lines
property onion-item
and have that particular instance override whatever lineion-list
was trying to set. However, it did this by duplicating styles that were already set in theion-item
stylesheets.This is the new architecture:
item-lines-default
class is set onion-item
when nolines
property is set.ion-list
targetsion-item
with theitem-lines-default
class when setting the lines.lines
onion-item
, then theitem-lines-default
class is removed and the styles in 2 no longer apply. This allows developers to override the list behavior on a per-item basis.iOS
main
Note: This was previously considered an Ionic 7.0 task. However, I would like to consider this a non-breaking change since the
lines
property onion-list
is not functional. Additionally, the lines should always have been 0.55px instead of 1px.MD
Fixing the padding issue reveals the lines bug.
main
In the "branch" screenshot, the first item in the list has both an inset and a full line. This is also happening in
main
, but the lack of padding causes this issue to not be visible.lines="inset"
is set onion-list
This likely has been an issue for several years, but we never caught it since we did not have test coverage for this use case. Tests have been added.
Does this introduce a breaking change?
This does not change the specificity of the selector. Prior to this change we were doing
.list-ios-lines-full .item
. Now we are doing.list-ios-lines-full .item-lines-default
. As a result, any app-specific CSS overrides should still work.Other information