From b4f34054efa9b720df4001a5e8bb1efe515407fb Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 9 Jan 2019 11:31:30 -0600 Subject: [PATCH] fix(icon): fix rtl detail icon for ios (#17016) Closes #14958 --- core/src/components/item/item.tsx | 7 ++++++- core/src/components/item/test/icons/e2e.ts | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/src/components/item/item.tsx b/core/src/components/item/item.tsx index e78df24047..df31a67df4 100644 --- a/core/src/components/item/item.tsx +++ b/core/src/components/item/item.tsx @@ -142,13 +142,18 @@ export class Item implements ComponentInterface { } render() { - const { href, detail, mode, win, detailIcon, routerDirection, type } = this; + const { href, detail, mode, win, routerDirection, type } = this; + let detailIcon = this.detailIcon; const clickable = this.isClickable(); const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div' as any; const attrs = TagType === 'button' ? { type } : { href }; const showDetail = detail !== undefined ? detail : mode === 'ios' && clickable; + if (showDetail && detailIcon === 'ios-arrow-forward' && document.dir === 'rtl') { + detailIcon = 'ios-arrow-back'; + } + return [ { const compare = await page.compareScreenshot(); expect(compare).toMatchScreenshot(); }); + +test('item: icons-rtl', async () => { + const page = await newE2EPage({ + url: '/src/components/item/test/icons?ionic:_testing=true&rtl=true' + }); + + const compare = await page.compareScreenshot(); + expect(compare).toMatchScreenshot(); +});