${counter.map(index => {
+ const isSelected = displayValue >= index + 1;
+
if (displayValue > index && displayValue < index + 1) {
// Users can click the current value to clear the rating. When this happens, we set this.isHovering to
// false to prevent the hover state from confusing them as they move the mouse out of the control. This
@@ -274,7 +279,7 @@ export default class WaRating extends WebAwesomeElement {
: `inset(0 0 0 ${(displayValue - index) * 100}%)`,
})}
>
- ${unsafeHTML(this.getSymbol(index + 1))}
+ ${unsafeHTML(this.getSymbol(index + 1, false))}
- ${unsafeHTML(this.getSymbol(index + 1))}
+ ${unsafeHTML(this.getSymbol(index + 1, true))}
`;
@@ -299,7 +304,7 @@ export default class WaRating extends WebAwesomeElement {
})}
role="presentation"
>
- ${unsafeHTML(this.getSymbol(index + 1))}
+ ${unsafeHTML(this.getSymbol(index + 1, isSelected))}
`;
})}