Skip to content

Commit

Permalink
Fix NaN for score selector
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Aug 13, 2024
1 parent d836a21 commit e16cb6e
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions web/src/pages/SubmitPlus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,16 @@ function PlusFilterGroup({
className="w-12"
inputMode="numeric"
value={Math.round((currentScoreRange?.at(0) ?? 0.5) * 100)}
onChange={(e) =>
setCurrentScoreRange([
parseInt(e.target.value) / 100.0,
currentScoreRange?.at(1) ?? 1.0,
])
}
onChange={(e) => {
const value = e.target.value;

if (value) {
setCurrentScoreRange([
parseInt(value) / 100.0,
currentScoreRange?.at(1) ?? 1.0,
]);
}
}}
/>
<DualThumbSlider
className="w-full"
Expand All @@ -513,12 +517,16 @@ function PlusFilterGroup({
className="w-12"
inputMode="numeric"
value={Math.round((currentScoreRange?.at(1) ?? 1.0) * 100)}
onChange={(e) =>
setCurrentScoreRange([
currentScoreRange?.at(0) ?? 0.5,
parseInt(e.target.value) / 100.0,
])
}
onChange={(e) => {
const value = e.target.value;

if (value) {
setCurrentScoreRange([
currentScoreRange?.at(0) ?? 0.5,
parseInt(value) / 100.0,
]);
}
}}
/>
</div>
<DropdownMenuSeparator />
Expand Down

0 comments on commit e16cb6e

Please sign in to comment.