Skip to content

Commit e651d6e

Browse files
committed
feat: add isOptionSelected prop to EnvironmentList for improved selection handling
1 parent 2f58a86 commit e651d6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/CIPipelineN/EnvironmentList.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export const EnvironmentList = ({
8282
return _selectedEnv
8383
}
8484

85+
const getIsOptionSelected = (option: EnvironmentWithSelectPickerType): boolean => {
86+
return selectedEnv?.id === option.id
87+
}
88+
8589
const getEnvironmentSelectLabel = (): JSX.Element => {
8690
if (isBuildStage) {
8791
return <span>Execute tasks in environment</span>
@@ -107,6 +111,7 @@ export const EnvironmentList = ({
107111
onChange={selectEnvironment}
108112
size={ComponentSizeType.large}
109113
variant={isBorderLess ? SelectPickerVariantType.COMPACT : SelectPickerVariantType.DEFAULT}
114+
isOptionSelected={getIsOptionSelected}
110115
/>
111116
</div>
112117
</div>

0 commit comments

Comments
 (0)