From bfe67e5b889efed5fac208b40a17eedbc2154882 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 20 Jul 2020 16:22:32 -0400 Subject: [PATCH] Improve rating selection --- src/components/rating/rating.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/rating/rating.tsx b/src/components/rating/rating.tsx index 98bf925a9..753c6b631 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) {