diff --git a/CHANGELOG.md b/CHANGELOG.md
index 145e2409df..886f83007c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Repository names may not end with ".git" ([#1277](https://github.com/scm-manager/scm-manager/pull/1277))
+- Add preselected value to options in dropdown component if missing ([#1287](https://github.com/scm-manager/scm-manager/pull/1287))
## [2.3.1] - 2020-08-04
### Added
diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
index 92c6869962..05297adf93 100644
--- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
+++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
@@ -38608,6 +38608,42 @@ exports[`Storyshots Forms|Checkbox With HelpText 1`] = `
`;
+exports[`Storyshots Forms|DropDown Add preselect if missing in options 1`] = `
+
+
+
+`;
+
exports[`Storyshots Forms|DropDown Default 1`] = `
The Meaning Of Liff
+
`;
diff --git a/scm-ui/ui-components/src/forms/DropDown.stories.tsx b/scm-ui/ui-components/src/forms/DropDown.stories.tsx
index e8c9006b50..7e1e3ed995 100644
--- a/scm-ui/ui-components/src/forms/DropDown.stories.tsx
+++ b/scm-ui/ui-components/src/forms/DropDown.stories.tsx
@@ -48,4 +48,14 @@ storiesOf("Forms|DropDown", module)
// nothing to do
}}
/>
+ ))
+ .add("Add preselect if missing in options", () => (
+ {
+ // nothing to do
+ }}
+ />
));
diff --git a/scm-ui/ui-components/src/forms/DropDown.tsx b/scm-ui/ui-components/src/forms/DropDown.tsx
index 8462d5bcb4..c141b35cd5 100644
--- a/scm-ui/ui-components/src/forms/DropDown.tsx
+++ b/scm-ui/ui-components/src/forms/DropDown.tsx
@@ -36,6 +36,11 @@ type Props = {
class DropDown extends React.Component {
render() {
const { options, optionValues, preselectedOption, className, disabled } = this.props;
+
+ if (preselectedOption && options.filter(o => o === preselectedOption).length === 0) {
+ options.push(preselectedOption);
+ }
+
return (