Skip to content

Commit

Permalink
fix(picker): do not change datetime/picker column order in RTL (#17018)
Browse files Browse the repository at this point in the history
Closes #16294
  • Loading branch information
adamdbradley committed Jan 9, 2019
1 parent b4f3405 commit 1338d71
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/.stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ rules:
- contain
- content
- cursor
- direction
- empty-cells
- object-fit
- opacity
Expand All @@ -254,7 +255,6 @@ rules:

property-blacklist:
- background-position
- direction
- right
- left
- float
Expand Down
16 changes: 16 additions & 0 deletions core/src/components/datetime/test/basic/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ test('datetime: basic', async () => {
compare = await page.compareScreenshot('should open custom picker');
expect(compare).toMatchScreenshot();
});

test('datetime: basic-rtl', async () => {
const page = await newE2EPage({
url: '/src/components/datetime/test/basic?ionic:_testing=true&rtl=true'
});

const datetime = await page.find('#customPickerOptions');
await datetime.click();

const picker = await page.find('ion-picker');
await picker.waitForVisible();
await page.waitFor(250);

const compare = await page.compareScreenshot('should open custom picker');
expect(compare).toMatchScreenshot();
});
2 changes: 1 addition & 1 deletion core/src/components/datetime/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

<ion-item>
<ion-label>h:mm a</ion-label>
<ion-datetime display-format="h:mm a"></ion-datetime>
<ion-datetime display-format="h:mm a" value="01:47"></ion-datetime>
</ion-item>

<ion-item>
Expand Down
6 changes: 1 addition & 5 deletions core/src/components/picker/picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@
// --------------------------------------------------

.picker-columns {
@include rtl() {
// Date is the same format in both directions
flex-direction: row-reverse;
}

display: flex;
position: relative;

Expand All @@ -121,6 +116,7 @@
margin-bottom: var(--ion-safe-area-bottom, 0);

contain: strict;
direction: ltr;
overflow: hidden;
}

Expand Down

0 comments on commit 1338d71

Please sign in to comment.