Skip to content

Commit

Permalink
Fix switching from compare to formula with empty value
Browse files Browse the repository at this point in the history
  • Loading branch information
wimdenherder committed Jun 3, 2023
1 parent 2dc9b93 commit f0df3d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion formula_builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,11 @@

function SelectInput({options, value, disabled, onChange}) {
const displayValue = value.includes(cfg.delimiter) ? "compare" : value;
const updatedOptions = value === "" ? [""].concat(options) : options;

return (
<select disabled={disabled} value={displayValue} onChange={onChange}>
{options.map(x => <option value={x}>{x}</option>)}
{updatedOptions.map(x => <option value={x}>{x || "Please select"}</option>)}
</select>
);
}
Expand Down

0 comments on commit f0df3d4

Please sign in to comment.