Skip to content
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(item): elements should wrap and label should not collapse when text size increases #28146

Merged
merged 80 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
937c44d
feat: add dynamic type variables (#27745)
liamdebeasi Jul 6, 2023
563fda7
feat(action-sheet): support dynamic type (#27747)
liamdebeasi Jul 10, 2023
c7126a4
feat(breadcrumb): support dynamic type (#27759)
liamdebeasi Jul 12, 2023
fff2114
feat(back-button): support dynamic type (#27750)
liamdebeasi Jul 12, 2023
7713ea6
feat(badge): support dynamic type (#27772)
liamdebeasi Jul 12, 2023
914c6f2
test(many): add font scaling tests (#27836)
liamdebeasi Jul 20, 2023
648d06a
feat(loading): support for dynamic type (#27828)
liamdebeasi Jul 25, 2023
4ee14c4
feat(reorder): support dynamic type (#27838)
liamdebeasi Jul 25, 2023
2737871
feat(card): support dynamic type (#27845)
thetaPC Jul 26, 2023
92c6b59
feat(datetime-button): add dynamic type support (#27848)
brandyscarney Jul 26, 2023
a62040f
fix(datetime-button): buttons wrap instead of truncate (#27872)
liamdebeasi Jul 31, 2023
afcc7eb
feat(button): support dynamic type (#27887)
brandyscarney Aug 4, 2023
c9b2792
feat(buttons): support dynamic type (#27896)
brandyscarney Aug 4, 2023
8fae6da
feat(chip): add dynamic type support (#27868)
mapsandapps Aug 8, 2023
7b458b6
refactor: add dynamic type sass functions (#27934)
liamdebeasi Aug 8, 2023
b37121d
feat(list-header): support dynamic type (#27938)
brandyscarney Aug 8, 2023
ed54502
feat(note): support dynamic type (#27946)
brandyscarney Aug 9, 2023
251a40a
feat(item-divider): support dynamic type (#27947)
brandyscarney Aug 9, 2023
b3948d6
feat(label): support dynamic type (#27962)
brandyscarney Aug 17, 2023
5a72eca
feat(menu-button): support dynamic type (#28008)
brandyscarney Aug 17, 2023
28f6c4a
Merge remote-tracking branch 'origin/main' into sp/FW-4146-sync-2
sean-perkins Aug 18, 2023
441e534
chore(): add updated snapshots (#28027)
sean-perkins Aug 21, 2023
221d778
Merge pull request #28026 from ionic-team/sp/FW-4146-sync-2
sean-perkins Aug 21, 2023
b1cc988
feat(typography): support dynamic type (#28045)
brandyscarney Aug 24, 2023
bcc0343
feat(item-option): support dynamic type (#28050)
brandyscarney Aug 24, 2023
b453ef5
feat(range): support dynamic type (#28006)
liamdebeasi Aug 25, 2023
fc39cd3
feat(searchbar): support dynamic type (#28043)
liamdebeasi Aug 28, 2023
9e5f732
feat(textarea): support dynamic type (#28068)
mapsandapps Aug 29, 2023
e4cc457
feat(toolbar): support dynamic type (#28073)
liamdebeasi Aug 30, 2023
a23c122
feat(title): support dynamic type (#27990)
thetaPC Aug 30, 2023
dcd23e1
feat(toast): support dynamic type (#28051)
sean-perkins Sep 1, 2023
464198c
feat(item): support dynamic type (#27989)
brandyscarney Sep 6, 2023
c59eaf1
chore: sync with main
liamdebeasi Sep 6, 2023
6bae0be
chore(): add updated snapshots
Ionitron Sep 6, 2023
f4ce2af
chore: sync with main
liamdebeasi Sep 6, 2023
921faac
refactor(item-options): remove unnecessary font-size style (#28133)
brandyscarney Sep 6, 2023
1286175
fix(header): do not apply safe area padding to collapsible large titl…
liamdebeasi Sep 7, 2023
ae3668a
fix(item): don't allow label to collapse from sibling content
brandyscarney Sep 7, 2023
26962d9
fix(searchbar): searchbar in collapsible header has correct height (#…
liamdebeasi Sep 8, 2023
c55c492
refactor: rename dynamic font variable (#28145)
liamdebeasi Sep 8, 2023
ded7862
style: comment typo
brandyscarney Sep 8, 2023
98de185
fix: add fallback for when not enabled (#28142)
liamdebeasi Sep 11, 2023
e3a6de3
feat(datetime): support dynamic type (#28129)
liamdebeasi Sep 15, 2023
19dc5cf
fix(item): add flex wrap to input wrapper for content in default slot
brandyscarney Sep 18, 2023
bcd52f1
fix(label): add overflow for no wrap labels
brandyscarney Sep 18, 2023
1f23ffc
test(note): add a11y test for long note and label
brandyscarney Sep 18, 2023
7597cce
feat(input): support dynamic type (#28184)
averyjohnston Sep 19, 2023
345cd24
chore: sync with main
liamdebeasi Sep 26, 2023
5935bab
fix(datetime): display day wrapper correctly
liamdebeasi Sep 26, 2023
6a905f7
chore(): add updated snapshots
Ionitron Sep 26, 2023
e5aff3d
chore: sync with main
liamdebeasi Sep 26, 2023
f932cf3
fix(radio): radio mark icon scales with font (#28237)
liamdebeasi Sep 27, 2023
bdb230c
fix(select): add scaling to icon (#28239)
thetaPC Sep 27, 2023
e68dfcf
refactor(many): convert dynamic type rem values to Sass functions (#2…
brandyscarney Sep 28, 2023
3e7414e
fix(checkbox): icon scales with font (#28249)
thetaPC Sep 28, 2023
5b2b50e
feat(alert): support dynamic font scaling (#28236)
liamdebeasi Sep 29, 2023
f742c9c
Merge branch 'FW-4146' into FW-4905
brandyscarney Oct 3, 2023
d65fdf5
test(item): remove old comment
brandyscarney Oct 3, 2023
eb79794
test(item): remove item/text test which is a duplicate of basic
brandyscarney Oct 3, 2023
4f14f39
style: lint
brandyscarney Oct 3, 2023
a8a34ce
test(label): update legacy tests with right attrs
brandyscarney Oct 3, 2023
6ec8bf4
fix(item): do not wrap for legacy items and inputs
brandyscarney Oct 3, 2023
4285b30
fix(label): allow the text to shrink to its content and wrap
brandyscarney Oct 3, 2023
9bdad96
fix(datetime): set width to auto for its label to avoid wrapping in c…
brandyscarney Oct 3, 2023
6804aea
fix(select): allow select to shrink when inside an item
brandyscarney Oct 3, 2023
a71e744
style: lint
brandyscarney Oct 3, 2023
7f5993b
style: update comment to include ticket number
brandyscarney Oct 3, 2023
c8aa8da
style(datetime): this class is already used on a datetime inside an item
brandyscarney Oct 3, 2023
0e54a81
fix(item): switch to using unset and add missing property unset to label
brandyscarney Oct 4, 2023
8c23dca
fix(label): only add flex-grow if label is not in a legacy or input item
brandyscarney Oct 5, 2023
077fb08
fix(label): apply overflow hidden specifically to skeleton text and l…
brandyscarney Oct 12, 2023
65ee746
chore: build
brandyscarney Oct 12, 2023
168daf2
Merge remote-tracking branch 'origin/feature-7.5' into FW-4905
brandyscarney Oct 12, 2023
4d51615
test(alert): fix bad merge
brandyscarney Oct 12, 2023
962ca25
fix(checkbox): bad merge
brandyscarney Oct 12, 2023
88106d8
refactor(datetime): style the item directly in datetime
brandyscarney Oct 12, 2023
631030c
fix(datetime): width auto should be on label
brandyscarney Oct 12, 2023
3485a02
docs(skeleton-text): add comment explaining why it emits a style
brandyscarney Oct 17, 2023
5ab4c4a
Merge branch 'feature-7.6' into FW-4905
brandyscarney Oct 17, 2023
bc54c66
chore(): add updated snapshots (#28278)
brandyscarney Oct 17, 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
8 changes: 8 additions & 0 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,10 @@ export interface IonSelectCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLIonSelectElement;
}
export interface IonSkeletonTextCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLIonSkeletonTextElement;
}
export interface IonSplitPaneCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLIonSplitPaneElement;
Expand Down Expand Up @@ -6921,6 +6925,10 @@ declare namespace LocalJSX {
* If `true`, the skeleton text will animate.
*/
"animated"?: boolean;
/**
* Emitted when the styles change.
*/
"onIonStyle"?: (event: IonSkeletonTextCustomEvent<StyleEventDetail>) => void;
}
interface IonSpinner {
/**
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions core/src/components/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ export class Checkbox implements ComponentInterface {
private emitStyle() {
const style: StyleEventDetail = {
'interactive-disabled': this.disabled,
// TODO(FW-3100): remove this
legacy: !!this.legacy,
};

// TODO(FW-3100): remove this
Expand Down
8 changes: 8 additions & 0 deletions core/src/components/datetime/datetime.scss
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ ion-picker-column-internal {
justify-content: space-between;
}

// TODO(FW-3547): the styles targeting ion-item
// can be removed if we refactor datetime to
// not use an ion-item
:host .calendar-action-buttons ion-item,
:host .calendar-action-buttons ion-button {
--background: translucent;
Expand All @@ -252,6 +255,11 @@ ion-picker-column-internal {
display: flex;

align-items: center;

// Width is set to auto because it is set
// to min-content elsewhere and we want to
// prevent wrapping the label in datetime
width: auto;
}

:host .calendar-action-buttons ion-item ion-icon {
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.
2 changes: 2 additions & 0 deletions core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ export class Input implements ComponentInterface {
'has-value': this.hasValue(),
'has-focus': this.hasFocus,
'interactive-disabled': this.disabled,
// TODO(FW-2764): remove this
legacy: !!this.legacy,
});
}
}
Expand Down
24 changes: 12 additions & 12 deletions core/src/components/input/test/legacy/spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,47 @@ <h1>Floating Inputs</h1>
<h2>Inactive</h2>
<ion-item>
<ion-label position="floating">Label</ion-label>
<ion-input placeholder="Placeholder Text"></ion-input>
<ion-input legacy="true" placeholder="Placeholder Text"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Focused</h2>
<ion-item class="item-has-focus">
<ion-label position="floating">Label</ion-label>
<ion-input placeholder="Placeholder Text"></ion-input>
<ion-input legacy="true" placeholder="Placeholder Text"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Activated</h2>
<ion-item>
<ion-label position="floating">Label</ion-label>
<ion-input placeholder="Placeholder Text" value="Input Text"></ion-input>
<ion-input legacy="true" placeholder="Placeholder Text" value="Input Text"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Hover</h2>
<ion-item class="item-hovered">
<ion-label position="floating">Label</ion-label>
<ion-input></ion-input>
<ion-input legacy="true"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Disabled</h2>
<ion-item>
<ion-label position="floating">Label</ion-label>
<ion-input disabled></ion-input>
<ion-input legacy="true" disabled></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Toggle Placeholder</h2>
<ion-item>
<ion-label position="floating">Label</ion-label>
<ion-input id="floatingToggle" type="password"></ion-input>
<ion-input legacy="true" id="floatingToggle" type="password"></ion-input>
<ion-button
fill="clear"
slot="end"
Expand All @@ -89,47 +89,47 @@ <h1>Stacked Inputs</h1>
<h2>Inactive</h2>
<ion-item>
<ion-label position="stacked">Label</ion-label>
<ion-input></ion-input>
<ion-input legacy="true"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Focused</h2>
<ion-item class="item-has-focus">
<ion-label position="stacked">Label</ion-label>
<ion-input placeholder="Placeholder Text"></ion-input>
<ion-input legacy="true" placeholder="Placeholder Text"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Activated</h2>
<ion-item>
<ion-label position="stacked">Label</ion-label>
<ion-input placeholder="Placeholder Text" value="Input Text"></ion-input>
<ion-input legacy="true" placeholder="Placeholder Text" value="Input Text"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Hover</h2>
<ion-item class="item-hovered">
<ion-label position="stacked">Label</ion-label>
<ion-input></ion-input>
<ion-input legacy="true"></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Disabled</h2>
<ion-item>
<ion-label position="stacked">Label</ion-label>
<ion-input disabled></ion-input>
<ion-input legacy="true" disabled></ion-input>
</ion-item>
</div>

<div class="column">
<h2>Toggle Placeholder</h2>
<ion-item>
<ion-label position="stacked">Label</ion-label>
<ion-input id="stackedToggle" type="password"></ion-input>
<ion-input legacy="true" id="stackedToggle" type="password"></ion-input>
<ion-button
fill="clear"
slot="end"
Expand Down
67 changes: 64 additions & 3 deletions core/src/components/item/item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@
display: flex;
position: relative;

// Flex wrap is required here in order to wrap
// the start slot + .item-inner content that
// doesn't fit on the same line
flex-wrap: wrap;

align-items: inherit;
justify-content: inherit;

Expand All @@ -231,9 +236,15 @@
background: var(--background);

overflow: inherit;
box-sizing: border-box;

z-index: 1;

box-sizing: border-box;
}

// TODO(FW-5289): remove
:host(.item-legacy) .item-native {
flex-wrap: unset;
}

.item-native::-moz-focus-inner {
Expand Down Expand Up @@ -273,11 +284,25 @@ button, a {
// This is required to work with an inset highlight
position: relative;

flex: 1;
// This flex property is required in order to make
// the elements wrap when there is a slotted start
// element and a label
flex: 1 0 auto;

flex-direction: inherit;

// Flex wrap is required here in order to wrap
// .input-wrapper content + the end slot that
// doesn't fit on the same line
flex-wrap: wrap;

align-items: inherit;
align-self: stretch;

// Max width must be set to 100%, otherwise the
// elements will overflow this container instead
// of wrapping
max-width: 100%;
min-height: inherit;

border-width: var(--inner-border-width);
Expand All @@ -289,6 +314,14 @@ button, a {
box-sizing: border-box;
}

// TODO(FW-5289): remove
:host(.item-legacy) .item-inner {
flex: 1;

flex-wrap: unset;

max-width: unset;
}

// Item Bottom
// --------------------------------------------------
Expand Down Expand Up @@ -349,6 +382,11 @@ button, a {

::slotted(ion-label:not([slot="end"])) {
flex: 1;

// Setting width to min-content allows the label to
// shrink and wrap its text instead of moving to its
// own row if there are slotted elements next to it
width: min-content;
}

// Item Input
Expand All @@ -361,18 +399,41 @@ button, a {
.input-wrapper {
display: flex;

flex: 1;
// This flex property is required in order to keep
// the label from shrinking when there are wide
// elements next to it
flex: 1 0 auto;

flex-direction: inherit;

// Flex wrap is required here in order to wrap
// content in the default slot (such as a label
// and a button) that doesn't fit on the same line
flex-wrap: wrap;

align-items: inherit;
align-self: stretch;

// Max width must be set to 100%, otherwise the
// elements will overflow this container instead
// of wrapping
max-width: 100%;

text-overflow: ellipsis;

overflow: inherit;
box-sizing: border-box;
}

// TODO(FW-5289): remove
:host(.item-legacy) .input-wrapper {
flex: 1;

flex-wrap: unset;

max-width: unset;
}

:host(.item-label-stacked),
:host(.item-label-floating) {
align-items: start;
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.
16 changes: 9 additions & 7 deletions core/src/components/item/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
</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-label class="ion-text-nowrap">
Single line text that should have ellipses when it doesn't all fit in the item
</ion-label>
</ion-item>

<ion-item lines="none">
<ion-label> Single line item with no lines</ion-label>
<ion-label>Single line item with no lines</ion-label>
</ion-item>

<ion-item>
Expand All @@ -57,21 +59,21 @@
</ion-item>

<ion-item color="secondary">
<ion-label class="ion-text-wrap">
<ion-label>
<h1>H1 Title Text</h1>
<p>Paragraph line 1</p>
</ion-label>
</ion-item>

<ion-item>
<ion-label class="ion-text-wrap">
<ion-label>
<h2>H2 Title Text</h2>
<p>Paragraph line 1</p>
</ion-label>
</ion-item>

<ion-item>
<ion-label class="ion-text-wrap">
<ion-label>
<ion-text color="primary">
<h3>H3 Title Text</h3>
</ion-text>
Expand All @@ -83,7 +85,7 @@ <h3>H3 Title Text</h3>
</ion-item>

<ion-item>
<ion-label class="ion-text-wrap">
<ion-label>
<h4>H4 Title Text</h4>
<p>Paragraph line 1</p>
<p>Paragraph line 2</p>
Expand All @@ -92,7 +94,7 @@ <h4>H4 Title Text</h4>
</ion-item>

<ion-item>
<ion-label> Item using inner ion-label </ion-label>
<ion-label>Item using inner ion-label </ion-label>
</ion-item>

<ion-item class="overflow-visible">
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.
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.
3 changes: 1 addition & 2 deletions core/src/components/item/test/disabled/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@

<ion-item>
<ion-checkbox aria-label="Checkbox" slot="start"></ion-checkbox>
<ion-label>Checkbox + Toggle</ion-label>
<ion-toggle aria-label="Checkbox" disabled value="45"></ion-toggle>
<ion-toggle disabled value="45">Checkbox + Toggle</ion-toggle>
</ion-item>

<ion-item>
Expand Down
1 change: 0 additions & 1 deletion core/src/components/item/test/disabled/item.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {

await page.setIonViewport();

// TODO: FW-4037 - Fix label color inconsistency between disabled controls
await expect(page).toHaveScreenshot(screenshot(`item-disabled-diff`));
});
});
Expand Down
Loading
Loading