🐛 Fixed bool pattern option to hold value across renders
This commit is contained in:
parent
2a4c6b8656
commit
329e0f0ac8
1 changed files with 3 additions and 1 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue