stalefish 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/selectbox.mjs +3 -1
- package/package.json +1 -1
package/components/selectbox.mjs
CHANGED
|
@@ -91,12 +91,14 @@ class Selectbox extends Component {
|
|
|
91
91
|
<option value="${required ? 'Select an option' : ''}" ${!holdingPen[property] ? { selected: 'true' } : ''} ${required ? { disabled: 'disabled' } : ''}>${required ? 'Select an option' : ''}</option>
|
|
92
92
|
${options.map(option => {
|
|
93
93
|
let optionValue
|
|
94
|
+
let optionName
|
|
94
95
|
if (typeof option === 'object' && option.value !== undefined) {
|
|
95
96
|
optionValue = option.value
|
|
97
|
+
optionName = option.name
|
|
96
98
|
} else {
|
|
97
99
|
optionValue = option
|
|
98
100
|
}
|
|
99
|
-
return html`<option value="${optionValue}" ${holdingPen[property] === optionValue ? { selected: 'true' } : ''}>${optionValue}</option>`
|
|
101
|
+
return html`<option value="${optionValue}" ${holdingPen[property] === optionValue ? { selected: 'true' } : ''}>${optionName || optionValue}</option>`
|
|
100
102
|
})}
|
|
101
103
|
</select>
|
|
102
104
|
</label>
|