Skip to content

Commit

Permalink
chore(web-components): remove redundant ts suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorgenaev committed Sep 18, 2024
1 parent 62948fa commit ce11185
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
4 changes: 1 addition & 3 deletions packages/web-components/src/menu-item/menu-item.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export function menuItemTemplate<T extends MenuItem>(options: MenuItemOptions =
@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)}"
@toggle="${(x, c) =>
// @ts-expect-error - Baseline 2024
x.toggleHandler(c.event as ToggleEvent)}"
@toggle="${(x, c) => x.toggleHandler(c.event as ToggleEvent)}"
>
<slot name="indicator"> ${staticallyCompose(options.indicator)} </slot>
${startSlotTemplate(options)}
Expand Down
7 changes: 0 additions & 7 deletions packages/web-components/src/menu-item/menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ export class MenuItem extends FASTElement {
case keyArrowRight:
//open/focus on submenu
if (!this.disabled) {
// @ts-expect-error - Baseline 2024
this.submenu?.togglePopover(true);
this.submenu?.focus();
}
Expand All @@ -193,7 +192,6 @@ export class MenuItem extends FASTElement {
case keyArrowLeft:
//close submenu
if (this.parentElement?.hasAttribute('popover')) {
// @ts-expect-error - Baseline 2024
this.parentElement.togglePopover(false);
// focus the menu item containing the submenu
this.parentElement.parentElement?.focus();
Expand Down Expand Up @@ -224,7 +222,6 @@ export class MenuItem extends FASTElement {
if (this.disabled) {
return false;
}
// @ts-expect-error - Baseline 2024
this.submenu?.togglePopover(true);
return false;
};
Expand All @@ -236,7 +233,6 @@ export class MenuItem extends FASTElement {
if (this.contains(document.activeElement)) {
return false;
}
// @ts-expect-error - Baseline 2024
this.submenu?.togglePopover(false);

return false;
Expand All @@ -247,13 +243,11 @@ export class MenuItem extends FASTElement {
* @internal
*/
public toggleHandler = (e: Event): void => {
// @ts-expect-error - Baseline 2024
if (e instanceof ToggleEvent && e.newState === 'open') {
this.setAttribute('tabindex', '-1');
this.elementInternals.ariaExpanded = 'true';
this.setSubmenuPosition();
}
// @ts-expect-error - Baseline 2024
if (e instanceof ToggleEvent && e.newState === 'closed') {
this.elementInternals.ariaExpanded = 'false';
this.setAttribute('tabindex', '0');
Expand All @@ -275,7 +269,6 @@ export class MenuItem extends FASTElement {

case MenuItemRole.menuitem:
if (!!this.submenu) {
// @ts-expect-error - Baseline 2024
this.submenu.togglePopover(true);
this.submenu.focus();
break;
Expand Down
3 changes: 0 additions & 3 deletions packages/web-components/src/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export class Menu extends FASTElement {
* @public
*/
public toggleMenu = () => {
// @ts-expect-error - Baseline 2024
this._menuList?.togglePopover(!this._open);
};

Expand All @@ -162,7 +161,6 @@ export class Menu extends FASTElement {
) {
return;
}
// @ts-expect-error - Baseline 2024
this._menuList?.togglePopover(false);

if (this.closeOnScroll) {
Expand All @@ -175,7 +173,6 @@ export class Menu extends FASTElement {
* @public
*/
public openMenu = (e?: Event) => {
// @ts-expect-error - Baseline 2024
this._menuList?.togglePopover(true);

if (e && this.openOnContext) {
Expand Down

0 comments on commit ce11185

Please sign in to comment.