Skip to content

Commit 1b89334

Browse files
committed
adjust to max if value over max
Signed-off-by: cbh778899 <[email protected]>
1 parent 725ab9e commit 1b89334

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/settings/components/ScrollBarComponent.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ export default function ScrollBarComponent({ cb, value, disabled, title, descrip
1616
setScrollValue(value);
1717
} else {
1818
if(!isNaN(+value)) {
19+
if(value > max) value = max;
1920
setScrollValue(times_10 ? value * 10 : value);
2021
}
2122
setTextValue(value);
2223
}
2324
}
2425

2526
useEffect(()=>{
26-
!isNaN(+textValue) && checkValue() && cb(+textValue);
27+
textValue !== value && !isNaN(+textValue) && checkValue() && cb(+textValue);
2728
// eslint-disable-next-line
2829
}, [textValue])
2930

0 commit comments

Comments
 (0)