Skip to content

Commit 1fc4b76

Browse files
fix(label): do not grow when in end slot (#29036)
Issue number: resolves #29033 --------- <!-- 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. --> In #28773 I resolved several incorrect behaviors with Items related to text wrapping. However, it looks like I missed the removal of https://github.com/ionic-team/ionic-framework/pull/28146/files#diff-4a1156704dbf45b0dad273b6909b190ca45e4380aa7378ba88d0dd7d48d7d473R37 which caused the issue to persist when adding a label to the end slot. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Removed logic that caused `ion-label` to grow larger than it needed to be | `main` | branch | | - | - | | ![Screenshot 2024-02-13 at 11 20 43 AM](https://github.com/ionic-team/ionic-framework/assets/2721089/3fbddd04-d4b5-474c-ab9c-4d9c6e88f758) | ![Screenshot 2024-02-13 at 11 21 17 AM](https://github.com/ionic-team/ionic-framework/assets/2721089/188eda24-ec6f-4ba7-b3ed-2993d93b1cc7) | ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `7.7.2-dev.11707840956.16e27b4c` --------- Co-authored-by: ionitron <hi@ionicframework.com>
1 parent 6b781fb commit 1fc4b76

8 files changed

+27
-8
lines changed

core/src/components/label/label.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@
2929
overflow: hidden;
3030
}
3131

32-
// TODO(FW-5289): move to :host-context(.item)
33-
// Shouldn't need :not(.item-input) as this was
34-
// only needed because of the specificity with
35-
// :not(.item-legacy)
36-
:host-context(.item:not(.item-input):not(.item-legacy)) {
37-
flex-grow: 1;
38-
}
39-
4032
:host(.ion-color) {
4133
color: current-color(base);
4234
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { expect } from '@playwright/test';
2+
import { configs, test } from '@utils/test/playwright';
3+
4+
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
5+
test.describe(title('label: in item'), () => {
6+
test('should render correctly in an item', async ({ page }) => {
7+
test.info().annotations.push({
8+
type: 'issue',
9+
description: 'https://github.com/ionic-team/ionic-framework/issues/29033',
10+
});
11+
await page.setContent(
12+
`
13+
<ion-item>
14+
<ion-label slot="start">Start</ion-label>
15+
<ion-label>Default</ion-label>
16+
<ion-label slot="end">End</ion-label>
17+
</ion-item>
18+
`,
19+
config
20+
);
21+
22+
const item = page.locator('ion-item');
23+
24+
await expect(item).toHaveScreenshot(screenshot(`label-item`));
25+
});
26+
});
27+
});
2.57 KB
Loading
2.75 KB
Loading
2.31 KB
Loading
2.49 KB
Loading
2.6 KB
Loading
2.12 KB
Loading

0 commit comments

Comments
 (0)