fix(frontend): highlight preceding stars on hover in LikertScale (#10948)

This commit is contained in:
tksrmz
2025-09-12 23:01:40 +09:00
committed by GitHub
parent 74753036bb
commit 77ee9e25d9

View File

@@ -188,7 +188,7 @@ export function LikertScale({
return selectedRating && selectedRating >= rating
? "text-yellow-400"
: "text-gray-300 hover:text-yellow-200";
: "text-gray-300";
};
return (
@@ -206,7 +206,12 @@ export function LikertScale({
key={rating}
onClick={() => handleRatingClick(rating)}
disabled={isSubmitted}
className={cn("text-xl transition-all", getButtonClass(rating))}
className={cn(
"oh-star text-xl transition-all",
getButtonClass(rating),
!isSubmitted &&
"hover:text-yellow-400 [&:has(~.oh-star:hover)]:text-yellow-400",
)}
aria-label={`Rate ${rating} stars`}
>
<FaStar />