Skip to content

Conversation

@ndeshev
Copy link
Contributor

@ndeshev ndeshev commented Jan 29, 2026

BGSOFUIRILA-4212

@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Jan 29, 2026

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview January 29, 2026 12:37 Inactive
@ndeshev ndeshev marked this pull request as ready for review January 30, 2026 07:58
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview January 30, 2026 08:02 Inactive
@ivoplashkov ivoplashkov requested a review from Vonahz January 30, 2026 08:05
<br>

<h3>Custom Icons - Hearts (readonly)</h3>
<ui5-rating-indicator id="rating-hearts-readonly" value="2.5" icon="heart" unselected-icon="heart-2" readonly></ui5-rating-indicator>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that if we remove unselected-icon here, RatingIndicator still change the icon to heart for unselected (unselected-icon does nothing). This happens only in readonly and disabled.

* @since 2.20
*/
@property()
icon?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use same naming as in the controls - iconSelected, iconUnselected

* @since 2.20
*/
@property()
unselectedIcon?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iconUnselected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half icon looks strange with custom icons because the way it was implemented is that icons go on top of one another:

Image

It is not mentions in the spec but maybe is good idea to discuss with it with the team

});

it("should use custom icon for unselected items when readonly", () => {
cy.mount(<RatingIndicator value={2} max={5} icon="heart" unselectedIcon="heart-2" readonly></RatingIndicator>);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is not working for custom unselectedIcon

});

it("should use custom icon for unselected items when disabled", () => {
cy.mount(<RatingIndicator value={2} max={5} icon="heart" unselectedIcon="heart-2" disabled></RatingIndicator>);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

return (
<li class="ui5-rating-indicator-item ui5-rating-indicator-item-unsel">
<Icon data-ui5-value={star.index} name={favorite} />
<Icon data-ui5-value={star.index} name={this.effectiveIcon} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use the UNselected icon as the is only for unselected.

</div>
</li>
);
} if (this.readonly) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add || this.disabled and delete the condition for disabled as they are the same with readonly

return (
<li class="ui5-rating-indicator-item ui5-rating-indicator-item-unsel">
<Icon data-ui5-value={star.index} name={favorite} />
<Icon data-ui5-value={star.index} name={this.effectiveIcon} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants