Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(menu-item): Ensure correct order of rendered icons #7098

Merged
merged 3 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
26 changes: 26 additions & 0 deletions src/components/menu-item/menu-item.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,32 @@ export const iconsBoth = (): string => html` <calcite-menu>
/>
</calcite-menu>`;

export const allIconsAndSubMenu_TestOnly = (): string => html` <calcite-menu>
<calcite-menu layout="horizontal">
<calcite-menu-item text="Example item 1" text-enabled></calcite-menu-item>
<calcite-menu-item text="Example item 2" text-enabled active></calcite-menu-item>
<calcite-menu-item text="Example item 3" text-enabled icon-start="layer" icon-end="layer" breadcrumb>
<calcite-menu-item slot="submenu-item" text="Example submenu item 1" text-enabled> </calcite-menu-item>
<calcite-menu-item slot="submenu-item" text="Example submenu item 2" text-enabled>
<calcite-menu-item slot="submenu-item" text="Example submenu item 1" text-enabled></calcite-menu-item>
</calcite-menu-item>
</calcite-menu-item>
<calcite-menu-item text="Example item 4" text-enabled></calcite-menu-item> </calcite-menu
></calcite-menu>`;

export const allIconsAndSubMenuVertical_TestOnly = (): string => html` <calcite-menu>
<calcite-menu layout="vertical">
<calcite-menu-item text="Example item 1" text-enabled></calcite-menu-item>
<calcite-menu-item text="Example item 2" text-enabled active></calcite-menu-item>
<calcite-menu-item text="Example item 3" text-enabled icon-start="layer" icon-end="layer" breadcrumb>
<calcite-menu-item slot="submenu-item" text="Example submenu item 1" text-enabled> </calcite-menu-item>
<calcite-menu-item slot="submenu-item" text="Example submenu item 2" text-enabled>
<calcite-menu-item slot="submenu-item" text="Example submenu item 1" text-enabled></calcite-menu-item>
</calcite-menu-item>
</calcite-menu-item>
<calcite-menu-item text="Example item 4" text-enabled></calcite-menu-item> </calcite-menu
></calcite-menu>`;

export const darkModeRTL_TestOnly = (): string =>
html`<calcite-menu-item
text="Menu item"
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu-item/menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ export class CalciteMenuItem implements LoadableComponent, T9nComponent, Localiz
<div class={CSS.textContainer}>
<span>{this.text}</span>
</div>
{!this.href && this.hasSubmenu ? this.renderDropdownIcon(dir) : null}
{this.breadcrumb ? this.renderBreadcrumbIcon(dir) : null}
{this.iconEnd && this.renderIconEnd()}
{this.breadcrumb ? this.renderBreadcrumbIcon(dir) : null}
{!this.href && this.hasSubmenu ? this.renderDropdownIcon(dir) : null}
</Fragment>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/demos/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ <h3>
</calcite-menu-item>
</calcite-menu-item>
</calcite-menu-item>
<calcite-menu-item text="Example nested" icon-start="layer">
<calcite-menu-item slot="submenu-item" title text="ArcGIS Online">
<calcite-menu-item text="Example nested" icon-start="layer" icon-end="layer">
<calcite-menu-item slot=" submenu-item" title text="ArcGIS Online">
<calcite-menu-item slot="submenu-item" text="Great examples"> </calcite-menu-item>
<calcite-menu-item slot="submenu-item" text="Capabilities">
<calcite-menu-item slot="submenu-item" text="Capabilities"> </calcite-menu-item>
Expand Down