Skip to content

Commit

Permalink
Remove unmatched closing div (#6988)
Browse files Browse the repository at this point in the history
# Pull Request

### 🎫 Issues

Closes #6848

## πŸ‘©β€πŸ’» Reviewer Notes

This is a re-implementation of #6848 due to waiting on response from contributor.
  • Loading branch information
janechu authored Jun 14, 2024
1 parent d1685de commit 6a0c57a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Remove unmatched closing div",
"packageName": "@microsoft/fast-foundation",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export function menuItemTemplate<T extends FASTMenuItem>(
options: MenuItemOptions = {}
): ElementViewTemplate<T> {
return html<T>`
<template
aria-haspopup="${x => (x.hasSubmenu ? "menu" : void 0)}"
aria-checked="${x => (x.role !== MenuItemRole.menuitem ? x.checked : void 0)}"
aria-disabled="${x => x.disabled}"
aria-expanded="${x => x.expanded}"
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event as KeyboardEvent)}"
@click="${(x, c) => x.handleMenuItemClick(c.event as MouseEvent)}"
@mouseover="${(x, c) => x.handleMouseOver(c.event as MouseEvent)}"
@mouseout="${(x, c) => x.handleMouseOut(c.event as MouseEvent)}"
>
<template
aria-haspopup="${x => (x.hasSubmenu ? "menu" : void 0)}"
aria-checked="${x => (x.role !== MenuItemRole.menuitem ? x.checked : void 0)}"
aria-disabled="${x => x.disabled}"
aria-expanded="${x => x.expanded}"
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event as KeyboardEvent)}"
@click="${(x, c) => x.handleMenuItemClick(c.event as MouseEvent)}"
@mouseover="${(x, c) => x.handleMouseOver(c.event as MouseEvent)}"
@mouseout="${(x, c) => x.handleMouseOut(c.event as MouseEvent)}"
>
${when(
x => x.role === MenuItemRole.menuitemcheckbox,
html<FASTMenuItem>`
Expand All @@ -49,38 +49,40 @@ export function menuItemTemplate<T extends FASTMenuItem>(
</div>
`
)}
</div>
${startSlotTemplate(options)}
<span class="content" part="content">
<slot></slot>
</span>
${endSlotTemplate(options)}
${when(
x => x.hasSubmenu,
html<T>`
<div
part="expand-collapse-glyph-container"
class="expand-collapse-glyph-container"
>
<span part="expand-collapse" class="expand-collapse">
<slot name="expand-collapse-indicator">
${staticallyCompose(options.expandCollapseGlyph)}
</slot>
</span>
</div>
`
)}
<span
?hidden="${x => !x.expanded}"
class="submenu-container"
part="submenu-container"
${ref("submenuContainer")}
>
<slot name="submenu" ${slotted({
property: "slottedSubmenu",
filter: elements("[role='menu']"),
})}></slot>
</span>
</template>
${startSlotTemplate(options)}
<span class="content" part="content">
<slot></slot>
</span>
${endSlotTemplate(options)}
${when(
x => x.hasSubmenu,
html<T>`
<div
part="expand-collapse-glyph-container"
class="expand-collapse-glyph-container"
>
<span part="expand-collapse" class="expand-collapse">
<slot name="expand-collapse-indicator">
${staticallyCompose(options.expandCollapseGlyph)}
</slot>
</span>
</div>
`
)}
<span
?hidden="${x => !x.expanded}"
class="submenu-container"
part="submenu-container"
${ref("submenuContainer")}
>
<slot
name="submenu"
${slotted({
property: "slottedSubmenu",
filter: elements("[role='menu']"),
})}
></slot>
</span>
</template>
`;
}

0 comments on commit 6a0c57a

Please sign in to comment.