diff --git a/src/components/context-menu/context-menu.ts b/src/components/context-menu/context-menu.ts index 89857016b..7c96cfcd6 100644 --- a/src/components/context-menu/context-menu.ts +++ b/src/components/context-menu/context-menu.ts @@ -43,6 +43,11 @@ export class CoreContextMenuComponent implements OnInit { this.hideMenu = !this.items.some((item) => { return !item.hidden; }); + + // Sort the items by priority. + this.items.sort((a, b) => { + return a.priority <= b.priority ? 1 : -1; + }); }); } diff --git a/src/core/contentlinks/providers/delegate.ts b/src/core/contentlinks/providers/delegate.ts index dc293023a..5aecc1f5a 100644 --- a/src/core/contentlinks/providers/delegate.ts +++ b/src/core/contentlinks/providers/delegate.ts @@ -301,7 +301,7 @@ export class CoreContentLinksDelegate { // Sort by priority. actions = actions.sort((a, b) => { - return a.priority >= b.priority ? 1 : -1; + return a.priority <= b.priority ? 1 : -1; }); // Fill result array.