Fix branch selector display revision if selected instead of first branch (#1767)

The select component displays the first option if the value is not part of the options. This behaviour breaks the BranchSelector which uses Select since version 2.22.0 (before it used the deprecated DropDown component). The BranchSelector has to display the revision if one is selected, which is not part of the options.
This change will add a addValueToOptions property to the Select component and restore the old behaviour.
This commit is contained in:
Sebastian Sdorra
2021-08-16 14:54:50 +02:00
committed by GitHub
parent c03a9f6fcb
commit a7bb67f36b
5 changed files with 152 additions and 10 deletions

View File

@@ -64,6 +64,7 @@ const BranchSelector: FC<Props> = ({ branches, onSelectBranch, selectedBranch, l
onChange={(branch) => onSelectBranch(branches.filter((b) => b.name === branch)[0])}
disabled={!!disabled}
value={selectedBranch}
addValueToOptions={true}
/>
</MinWidthControl>
</NoBottomMarginField>