diff --git a/docs/docs/resources/changelog.md b/docs/docs/resources/changelog.md index 004e99aa8..cf0f2a466 100644 --- a/docs/docs/resources/changelog.md +++ b/docs/docs/resources/changelog.md @@ -30,6 +30,7 @@ New versions of Web Awesome are released as-needed and generally occur when a cr - Fixed a bug in `` classes [#1974] - Fixed a bug in `` that may throw errors on `disconnectedCallback` in test environments [#1985] - Fixed a bug in `` that would log a non-passive event listener warning [#2005] +- Fixed a bug in the submenu controller that allowed submenus to go offscreen and not be scrollable [#2001] ## 2.15.0 diff --git a/src/components/menu-item/menu-item.styles.ts b/src/components/menu-item/menu-item.styles.ts index 1dbe44ed1..93a6a4a75 100644 --- a/src/components/menu-item/menu-item.styles.ts +++ b/src/components/menu-item/menu-item.styles.ts @@ -144,4 +144,9 @@ export default css` outline-offset: -1px; } } + + ::slotted(sl-menu) { + max-width: var(--auto-size-available-width) !important; + max-height: var(--auto-size-available-height) !important; + } `; diff --git a/src/components/menu-item/submenu-controller.ts b/src/components/menu-item/submenu-controller.ts index 1e95e6ba0..95b09a14f 100644 --- a/src/components/menu-item/submenu-controller.ts +++ b/src/components/menu-item/submenu-controller.ts @@ -279,6 +279,8 @@ export class SubmenuController implements ReactiveController { flip-fallback-strategy="best-fit" skidding="${this.skidding}" strategy="fixed" + auto-size="vertical" + auto-size-padding="10" >