From ea7843a49c3744fbf9b95130ad73df5a9b633f34 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Monroy Date: Thu, 19 Sep 2024 11:06:31 -0400 Subject: [PATCH] feat(editor-content): fix error with block editor #2999 (#30046) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Proposed Changes * Fix track by function ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Screenshots Original | Updated :-------------------------:|:-------------------------: ![Screenshot 2024-09-17 at 5 44 32 PM](https://github.com/user-attachments/assets/10d27134-8c62-44db-bbdc-57c1e522dbda) | ![Screenshot 2024-09-17 at 4 56 12 PM](https://github.com/user-attachments/assets/bd058e06-7ffd-49f1-afaa-7cd6cd9edecb) --------- Co-authored-by: Arcadio Quintero --- .../suggestions-list-item/suggestions-list-item.component.ts | 2 +- .../shared/components/suggestions/suggestions.component.html | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core-web/libs/block-editor/src/lib/shared/components/suggestion-list/components/suggestions-list-item/suggestions-list-item.component.ts b/core-web/libs/block-editor/src/lib/shared/components/suggestion-list/components/suggestions-list-item/suggestions-list-item.component.ts index 4e333eb9fb0b..5615c8bc3509 100644 --- a/core-web/libs/block-editor/src/lib/shared/components/suggestion-list/components/suggestions-list-item/suggestions-list-item.component.ts +++ b/core-web/libs/block-editor/src/lib/shared/components/suggestion-list/components/suggestions-list-item/suggestions-list-item.component.ts @@ -34,7 +34,7 @@ export class SuggestionsListItemComponent implements FocusableOption, OnInit { } ngOnInit() { - this.icon = this.icon = typeof this.url === 'string' && !(this.url.split('/').length > 1); + this.icon = typeof this.url === 'string' && !(this.url.split('/').length > 1); } getLabel(): string { diff --git a/core-web/libs/block-editor/src/lib/shared/components/suggestions/suggestions.component.html b/core-web/libs/block-editor/src/lib/shared/components/suggestions/suggestions.component.html index 0611e2bb4cb4..566a130c9093 100644 --- a/core-web/libs/block-editor/src/lib/shared/components/suggestions/suggestions.component.html +++ b/core-web/libs/block-editor/src/lib/shared/components/suggestions/suggestions.component.html @@ -4,7 +4,7 @@

{{ title }}

} - @for (item of items; track $index) { + @for (item of items; track item) { @if (item.id !== 'divider') { {{ title }} } @else {
} - -
-
}