fix(demos): snapshot validated values before asynchronous submissions
This commit is contained in:
@@ -28,10 +28,11 @@ function submit() {
|
||||
value.value > STOCK_AVAILABLE
|
||||
)
|
||||
return;
|
||||
const submittedValue = value.value;
|
||||
isSubmitting.value = true;
|
||||
// Simulate API call
|
||||
timer = setTimeout(() => {
|
||||
console.log("Order submitted:", { quantity: value.value });
|
||||
console.log("Order submitted:", { quantity: submittedValue });
|
||||
value.value = null;
|
||||
isSubmitting.value = false;
|
||||
}, 1500);
|
||||
|
||||
Reference in New Issue
Block a user