This repository was archived by the owner on Feb 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,13 @@ export function ControlItem(props) {
9797 for ( let i = 0 ; i < props . conditionalAttributes . options . length ; i ++ ) {
9898 if ( data == props . conditionalAttributes . options [ i ] ) {
9999 isOption = true ;
100- }
101- options = < > { options } < option value = { props . conditionalAttributes . options [ i ] } > { props . conditionalAttributes . options [ i ] } </ option > </ > ;
100+ }
101+ let optionLabel = props . conditionalAttributes . options [ i ] ;
102+ if ( typeof props . conditionalAttributes . optionLabels [ i ] !== "undefined" ) {
103+ optionLabel = props . conditionalAttributes . optionLabels [ i ] ;
104+ }
105+
106+ options = < > { options } < option value = { props . conditionalAttributes . options [ i ] } > { optionLabel } </ option > </ > ;
102107 }
103108
104109 if ( ! isOption ) {
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ export function DashboardItems(props) {
175175
176176 case "select" :
177177 conditionalAttributes . options = props . items [ i ] . options ;
178+ conditionalAttributes . optionLabels = props . items [ i ] . optionLabels ;
178179 break ;
179180 }
180181
@@ -213,8 +214,12 @@ export function DashboardItems(props) {
213214 case "config" :
214215 if ( inputType == "select" ) {
215216 let options ;
216- for ( let i = 0 ; i < conditionalAttributes . options . length ; i ++ ) {
217- options = < > { options } < option value = { conditionalAttributes . options [ i ] } > { conditionalAttributes . options [ i ] } </ option > </ > ;
217+ for ( let i = 0 ; i < conditionalAttributes . options . length ; i ++ ) {
218+ let label = conditionalAttributes . options [ i ] ;
219+ if ( typeof conditionalAttributes . optionLabels [ i ] !== "undefined" ) {
220+ label = conditionalAttributes . optionLabels [ i ] ;
221+ }
222+ options = < > { options } < option value = { conditionalAttributes . options [ i ] } > { label } </ option > </ > ;
218223 }
219224 confItems = < > { confItems }
220225 < p >
You can’t perform that action at this time.
0 commit comments