mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user