提交 6eb57f99 编写于 作者: S SteVen Batten

add posinset to menu items

fix #62007
上级 fc48088e
......@@ -139,6 +139,10 @@ export class Menu extends ActionBar {
this.mnemonics = new Map<KeyCode, Array<MenuActionItem>>();
this.push(actions, { icon: true, label: true, isMenu: true });
this.items.filter(item => !(item instanceof MenuSeparatorActionItem)).forEach((item: MenuActionItem, index: number, array: any[]) => {
item.updatePositionInSet(index + 1, array.length);
});
}
style(style: IMenuStyles): void {
......@@ -323,6 +327,11 @@ class MenuActionItem extends BaseActionItem {
this.applyStyle();
}
updatePositionInSet(pos: number, setSize: number): void {
this.item.setAttribute('aria-posinset', `${pos}`);
this.item.setAttribute('aria-setsize', `${setSize}`);
}
updateLabel(): void {
if (this.options.label) {
let label = this.getAction().label;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册