mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
@ -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 [
|
||||
<TagType
|
||||
{...attrs}
|
||||
|
@ -8,3 +8,12 @@ test('item: icons', async () => {
|
||||
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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user