From 329e0f0ac87d19bc8f4db63ea20216cfdf3dc421 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Thu, 4 Jul 2019 07:45:10 +0200 Subject: [PATCH] :bug: Fixed bool pattern option to hold value across renders --- .../src/DraftConfigurator/PatternOptionBool/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/components/src/DraftConfigurator/PatternOptionBool/index.js b/packages/components/src/DraftConfigurator/PatternOptionBool/index.js index 30ab1798161..4b3802cf22f 100644 --- a/packages/components/src/DraftConfigurator/PatternOptionBool/index.js +++ b/packages/components/src/DraftConfigurator/PatternOptionBool/index.js @@ -4,7 +4,9 @@ import FormFieldBool from "../../.form/FormFieldBool"; import OptionPreamble from "../OptionPreamble"; const PatternOptionBool = props => { - const [value, setValue] = useState(props.dflt); + const [value, setValue] = useState( + props.value === null ? props.dflt : props.value + ); const [expanded, setExpanded] = useState(false); const update = (name, newValue, evt) => {