diff --git a/renderer/components/Form/Select.js b/renderer/components/Form/Select.js index 4f780b4d9cc..b344c0bb853 100644 --- a/renderer/components/Form/Select.js +++ b/renderer/components/Form/Select.js @@ -165,18 +165,30 @@ const Select = props => { openMenu, toggleMenu, }) => { + /** + * getInitialValue - Get the initial selected value. + * + * @returns {string} Initial selected value. + */ const getInitialValue = () => { if (selectedItem) { return selectedItem.value } - if (initialSelectedItem) { - initialSelectedItem.value + return initialSelectedItem.value } - return '' } + /** + * getValue - Get the current selected value. + * + * @returns {string} Current selected value. + */ + const getValue = () => { + return selectedItem ? selectedItem.value : '' + } + return (
{label && ( @@ -199,6 +211,7 @@ const Select = props => { fieldApi={fieldApi} fieldState={fieldState} forwardedRef={inputRef} + value={getValue()} /> {isOpen ? : }