Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6c48d98
fix(select): inherit white-space in select-text to allow wrapping
brandyscarney Mar 15, 2023
f79e91f
test(select): add example for wrapping
brandyscarney Mar 15, 2023
5adc34c
chore(): add updated snapshots
Ionitron Mar 15, 2023
bc1ab5d
Merge branch 'main' into FW-3749
brandyscarney Mar 17, 2023
50cd325
Merge branch 'main' into FW-3749
brandyscarney Mar 20, 2023
ed4d61b
test(select): revert changes to basic test
brandyscarney Mar 20, 2023
45f9f05
test(select): add text wrapping e2e test
brandyscarney Mar 20, 2023
f1ed7cb
style(select): lint fix
brandyscarney Mar 20, 2023
0ff02b3
chore(): add updated snapshots
Ionitron Mar 20, 2023
e4f490c
test(select): not enough text in the test to make it wrap
brandyscarney Mar 20, 2023
ae2f68c
chore(): add updated snapshots
Ionitron Mar 20, 2023
a6d46b0
test(select): update examples to specify what is happening
brandyscarney Mar 21, 2023
4ae962c
test(e2e): remove screenshot files to rerun
brandyscarney Mar 21, 2023
c2c2684
Merge branch 'main' into FW-3749
brandyscarney Mar 21, 2023
eaa87d4
chore(): add updated snapshots
Ionitron Mar 21, 2023
b06f573
test(select): accidentally overriding previous captures
brandyscarney Mar 21, 2023
a7ddc3e
test(select): remove screenshots
brandyscarney Mar 21, 2023
54a94e8
chore(): add updated snapshots
Ionitron Mar 21, 2023
d24f26d
Merge branch 'main' into FW-3749
brandyscarney Mar 22, 2023
aed19aa
style(e2e): update comment to point to JIRA issue
brandyscarney Mar 22, 2023
a922fb1
revert chore(): add updated snapshots
brandyscarney Mar 22, 2023
ee688c2
Merge branch 'main' into FW-3749
liamdebeasi Mar 23, 2023
6139027
Merge branch 'main' into FW-3749
brandyscarney Mar 23, 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
4 changes: 3 additions & 1 deletion core/src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

font-family: $font-family-base;

white-space: nowrap;

overflow: hidden;
z-index: $z-index-item-input;
}
Expand Down Expand Up @@ -77,7 +79,7 @@ button {

text-overflow: ellipsis;

white-space: nowrap;
white-space: inherit;

overflow: hidden;
}
Expand Down
48 changes: 48 additions & 0 deletions core/src/components/select/test/wrapping/select.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';

test.describe('select: wrapping', () => {
test('should not wrap text by default', async ({ page, skip }) => {
skip.rtl();

await page.setContent(`
<ion-select value="nowrap" aria-label="Should Not Wrap">
<ion-select-option value="nowrap">Should not wrap when no label exists and no class is added to make the text wrap</ion-select-option>
</ion-select>
`);

const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(`select-nowrap-${page.getSnapshotSettings()}.png`);
});

test('should wrap text with class', async ({ page, skip }) => {
skip.rtl();

await page.setContent(`
<ion-select value="wrap" aria-label="Should Wrap" class="ion-text-wrap">
<ion-select-option value="wrap">Should wrap when no label exists and really long text exists to make it wrap the text</ion-select-option>
</ion-select>
`);

const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(`select-wrap-${page.getSnapshotSettings()}.png`);
});

test('should not wrap label while wrapping text with class', async ({ page, skip }) => {
skip.rtl();

// TODO(FW-3787) Make label a property of select
await page.setContent(`
<ion-item>
<ion-label>Really long label should not wrap</ion-label>
<ion-select value="wrap" aria-label="Should Wrap" class="ion-text-wrap">
<ion-select-option value="wrap">Should wrap value only when label exists and really long text exists to make it wrap the text</ion-select-option>
</ion-select>
</ion-label>
</ion-item>
`);

const select = page.locator('ion-item');
await expect(select).toHaveScreenshot(`select-wrap-with-label-${page.getSnapshotSettings()}.png`);
});
});
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.
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.