diff --git a/src/components/rating/rating.tsx b/src/components/rating/rating.tsx index 98bf925a..753c6b63 100644 --- a/src/components/rating/rating.tsx +++ b/src/components/rating/rating.tsx @@ -95,12 +95,8 @@ export class Rating { const newValue = this.getValueFromMousePosition(event); - if (newValue === this.value) { - this.value = 0; - this.isHovering = false; - } else { - this.value = newValue; - } + this.value = newValue === this.value ? 0 : newValue; + this.isHovering = false; } handleKeyDown(event: KeyboardEvent) {