merge: 同步 upstream/main 新功能到定制版本
- feat: Add slider verification code (bd67997) - fix bug: Inventory cannot be zero (1f7a6ee) - fix: resolve merge conflicts and lint errors
This commit is contained in:
@@ -70,6 +70,13 @@ export function EnhancedInput<T = string>({
|
||||
let inputValue = e.target.value;
|
||||
|
||||
if (props.type === "number") {
|
||||
if (inputValue === "0") {
|
||||
setValue("0");
|
||||
setInternalValue(0);
|
||||
onValueChange?.(processValue(0));
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
/^-?\d*\.?\d*$/.test(inputValue) ||
|
||||
inputValue === "-" ||
|
||||
@@ -105,11 +112,7 @@ export function EnhancedInput<T = string>({
|
||||
};
|
||||
|
||||
const handleBlur = () => {
|
||||
if (
|
||||
props.type === "number" &&
|
||||
value !== "" &&
|
||||
(value === "-" || value === ".")
|
||||
) {
|
||||
if (props.type === "number" && value && (value === "-" || value === ".")) {
|
||||
setValue("");
|
||||
setInternalValue("");
|
||||
onValueBlur?.("" as T);
|
||||
|
||||
Reference in New Issue
Block a user