Skip to content

Commit 7d677ba

Browse files
author
Chance Strickland
committed
Fix bug in App found in our integration test
1 parent 895b1a5 commit 7d677ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/App.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ export const App: React.FC = () => {
1414
<span className="text label" id="total-minutes">
1515
Total Time Estimate (in minutes)
1616
</span>
17-
<Minutes value={totalMinutes} onValueChange={setTotalMinutes}>
18-
<MinutesSubtract />
17+
<Minutes
18+
value={totalMinutes}
19+
onValueChange={(newValue) => {
20+
if (completedMinutes <= newValue) {
21+
setTotalMinutes(newValue);
22+
}
23+
}}
24+
>
25+
<MinutesSubtract disabled={totalMinutes === completedMinutes} />
1926
<MinutesInput aria-labelledby="total-minutes" />
2027
<MinutesAdd />
2128
</Minutes>

0 commit comments

Comments
 (0)