Skip to content

Commit

Permalink
Fixed component sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 7, 2024
1 parent 8610a81 commit 073a0ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Fixed a bug where very wide tables could bleed off the page.
- Fixed an error that occurred when activating a new user. ([#14316](https://github.com/craftcms/cms/issues/14316))
- Fixed a bug where newly-added components could be selected multiple times by component selects. ([#14320](https://github.com/craftcms/cms/issues/14320))
- Fixed a bug where components weren’t getting sorted alphabetically within component select menus.

## 5.0.0-alpha.13 - 2024-02-06

Expand Down
2 changes: 1 addition & 1 deletion src/templates/_includes/forms/componentSelect.twig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<div class="flex flex-nowrap">
{% set valueIds = values|map(component => component.getId()) %}

{{ disclosureMenu(options|sort(o => o.getUiLabel())|map(component => {
{{ disclosureMenu(options|sort((a, b) => a.getUiLabel() <=> b.getUiLabel())|map(component => {
type: 'button',
label: component.getUiLabel(),
icon: component is instance of('craft\\base\\Iconic') ? component.getIcon() : null,
Expand Down

0 comments on commit 073a0ac

Please sign in to comment.