Skip to content

Commit

Permalink
chore(menu): added a custom root submenu example in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
TarunAdobe committed Sep 4, 2024
1 parent 95674cd commit 8314907
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions packages/menu/stories/submenu.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,26 @@ export const contextMenu = (): TemplateResult => {
</sp-overlay>
`;
};

export const customRootSubmenu = (): TemplateResult => {
return html`
<sp-action-menu label="More Actions">
<sp-menu-item>Bronx</sp-menu-item>
<sp-menu-item id="submenu-item-1">
Brooklyn
<div role="menuitem" slot="submenu" style="padding: 12px">
<img
src="https://placekitten.com/200/200"
alt="Kitten"
style="width: 100%; height: auto; border-radius: 4px"
/>
<p>I am an arbitrary content in submenu</p>
</div>
</sp-menu-item>
</sp-action-menu>
`;
};

customRootSubmenu.swc_vrt = {
skip: true,
};
2 changes: 1 addition & 1 deletion packages/menu/test/submenu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ describe('Submenu', () => {
expect(rootItem1.open, 'finally closed 1').to.be.false;
expect(rootItem2.open, 'finally closed 2').to.be.false;
});
it.only('supports using non-menu-item elements as the root of a submenu', async () => {
it('supports using non-menu-item elements as the root of a submenu', async () => {
const el = await fixture<Menu>(html`
<sp-menu>
<sp-menu-item class="root">
Expand Down

0 comments on commit 8314907

Please sign in to comment.