refactor: Use toggleAttribute natively where possible (#2494)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent 2acec49b29
commit 48761f0478
13 changed files with 37 additions and 70 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import type { MenuItem } from '../config/schema/elements/custom/menu/types.js';
import type { MenuConfig } from '../config/schema/menu.js';
import type { Interaction } from '../types.js';
import { getActionConfigGivenAction } from '../utils/action';
import { arrayify, isTruthy, setOrRemoveAttribute } from '../utils/basic.js';
import { arrayify, isTruthy } from '../utils/basic.js';
import { AutoHideState, isAutoHidden as evaluateAutoHidden } from './auto-hide.js';
export class MenuController {
@@ -126,7 +126,7 @@ export class MenuController {
public setExpanded(expanded: boolean): void {
this._expanded = expanded;
setOrRemoveAttribute(this._host, expanded, 'expanded');
this._host.toggleAttribute('expanded', expanded);
this._host.requestUpdate();
}