mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
@ -142,13 +142,18 @@ export class Item implements ComponentInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
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 clickable = this.isClickable();
|
||||||
const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div' as any;
|
const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div' as any;
|
||||||
const attrs = TagType === 'button' ? { type } : { href };
|
const attrs = TagType === 'button' ? { type } : { href };
|
||||||
const showDetail = detail !== undefined ? detail : mode === 'ios' && clickable;
|
const showDetail = detail !== undefined ? detail : mode === 'ios' && clickable;
|
||||||
|
|
||||||
|
if (showDetail && detailIcon === 'ios-arrow-forward' && document.dir === 'rtl') {
|
||||||
|
detailIcon = 'ios-arrow-back';
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<TagType
|
<TagType
|
||||||
{...attrs}
|
{...attrs}
|
||||||
|
@ -8,3 +8,12 @@ test('item: icons', async () => {
|
|||||||
const compare = await page.compareScreenshot();
|
const compare = await page.compareScreenshot();
|
||||||
expect(compare).toMatchScreenshot();
|
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();
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user