You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
When childItems of IContributedMenuItem is type of IPromise<IContributedMenuItem[]> then the icon is ALWAYS treated as css class not as image url (so you cannot have icon as an image).
In this example I have menu item where icon is set to url and has child with exactly the same icon. The result will be as following:
"change state" menu item will have icon
"test child" will have empty icon because the generated html has set class to following <span class="icon menu-item-icon static/images/changeStatusAction.png" aria-hidden="true"></span>
To fix it I have to comment the Q line but I cannot do this in my project I need the IPromise.
menuHandler = (context: any) : IContributedMenuSource => {
return <IContributedMenuSource> {
getMenuItems: (actionContext: any) => {
let subMenus =
// comment the Q and the icon will work
Q(
Array<IContributedMenuItem>(
{
text: "test child",
icon: "static/images/changeStatusAction.png",
});
);
return new Array<IContributedMenuItem>(
{
text: "Change state",
groupId: "modify",
icon: "static/images/changeStatusAction.png",
childItems: subMenus,
}
);
}
};
}
VSS.register(VSS.getContribution().id, menuHandler);
The text was updated successfully, but these errors were encountered:
I am having the opposite problem in #44. I want a class and not an image. I never would have thought to wrap it in a promise. That's some very confusing behavior, and as far as I can see, not documented anywhere.
When childItems of IContributedMenuItem is type of IPromise<IContributedMenuItem[]> then the icon is ALWAYS treated as css class not as image url (so you cannot have icon as an image).
In this example I have menu item where icon is set to url and has child with exactly the same icon. The result will be as following:
<span class="icon menu-item-icon static/images/changeStatusAction.png" aria-hidden="true"></span>
To fix it I have to comment the Q line but I cannot do this in my project I need the IPromise.
The text was updated successfully, but these errors were encountered: