Skip to content
Open
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/components/menu-item/submenu-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@
private handlePopupReposition = () => {
const submenuSlot: HTMLSlotElement | null = this.host.renderRoot.querySelector("slot[name='submenu']");
const menu = submenuSlot?.assignedElements({ flatten: true }).filter(el => el.localName === 'sl-menu')[0];
const isRtl = getComputedStyle(this.host).direction === 'rtl';
const isOnLeft = this.popupRef.value?.attributes?.['data-current-placement']?.startsWith('left');

Check failure on line 198 in src/components/menu-item/submenu-controller.ts

View workflow job for this annotation

GitHub Actions / build

Unsafe member access .startsWith on an `any` value

Check failure on line 198 in src/components/menu-item/submenu-controller.ts

View workflow job for this annotation

GitHub Actions / build

Unsafe call of an `any` typed value

Check failure on line 198 in src/components/menu-item/submenu-controller.ts

View workflow job for this annotation

GitHub Actions / build

Unsafe assignment of an `any` value
if (!menu) {
return;
}

const { left, top, width, height } = menu.getBoundingClientRect();

this.host.style.setProperty('--safe-triangle-submenu-start-x', `${isRtl ? left + width : left}px`);
this.host.style.setProperty('--safe-triangle-submenu-start-x', `${isOnLeft ? left + width : left}px`);
this.host.style.setProperty('--safe-triangle-submenu-start-y', `${top}px`);
this.host.style.setProperty('--safe-triangle-submenu-end-x', `${isRtl ? left + width : left}px`);
this.host.style.setProperty('--safe-triangle-submenu-end-x', `${isOnLeft ? left + width : left}px`);
this.host.style.setProperty('--safe-triangle-submenu-end-y', `${top + height}px`);
};

Expand Down
Loading