Prechádzať zdrojové kódy

Fix `Stepper` clearing field value on blur when no input was typed

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu 1 mesiac pred
rodič
commit
15c3537530
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      src/components/ui/Stepper/Stepper.tsx

+ 3 - 1
src/components/ui/Stepper/Stepper.tsx

@@ -159,7 +159,9 @@ class Stepper extends React.Component<Props, State> {
   }
 
   handleInputBlur() {
-    this.commitChange(this.state.inputValue || "");
+    if (this.state.inputValue !== null) {
+      this.commitChange(this.state.inputValue);
+    }
     this.setState({ inputValue: null });
   }