Skip to content

Commit c3503de

Browse files
committed
Do not set icon color if the item is selected
1 parent e6967a4 commit c3503de

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-element-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export abstract class UmbTreeItemElementBase<
7171
private _isSelectable = false;
7272

7373
@state()
74-
private _isSelected = false;
74+
protected _isSelected = false;
7575

7676
@state()
7777
private _hasChildren = false;
@@ -168,7 +168,7 @@ export abstract class UmbTreeItemElementBase<
168168
const iconWithoutColor = icon?.split(' ')[0];
169169

170170
if (icon && iconWithoutColor) {
171-
return html`<umb-icon slot="icon" name="${this._isActive ? iconWithoutColor : icon}"></umb-icon>`;
171+
return html`<umb-icon slot="icon" name="${this._isActive || this._isSelected ? iconWithoutColor : icon}"></umb-icon>`;
172172
}
173173

174174
if (isFolder) {

src/Umbraco.Web.UI.Client/src/packages/documents/documents/tree/tree-item/document-tree-item.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class UmbDocumentTreeItemElement extends UmbTreeItemElementBase<
4343
<span id="icon-container" slot="icon" class=${classMap({ draft: this._isDraft })}>
4444
${icon && iconWithoutColor
4545
? html`
46-
<umb-icon id="icon" slot="icon" name="${this._isActive ? iconWithoutColor : icon}"></umb-icon>
46+
<umb-icon id="icon" slot="icon" name="${this._isActive || this._isSelected ? iconWithoutColor : icon}"></umb-icon>
4747
${this.#renderStateIcon()}
4848
`
4949
: nothing}

src/Umbraco.Web.UI.Client/src/packages/media/media/tree/tree-item/media-tree-item.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class UmbMediaTreeItemElement extends UmbTreeItemElementBase<UmbMediaTree
1414
<span id="icon-container" slot="icon">
1515
${icon && iconWithoutColor
1616
? html`
17-
<umb-icon id="icon" slot="icon" name="${this._isActive ? iconWithoutColor : icon}"></umb-icon>
17+
<umb-icon id="icon" slot="icon" name="${this._isActive || this._isSelected ? iconWithoutColor : icon}"></umb-icon>
1818
${this.#renderStateIcon()}
1919
`
2020
: nothing}

0 commit comments

Comments
 (0)