Skip to content

Commit

Permalink
fix(Select): default value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed Mar 17, 2022
1 parent cc01af8 commit eb00439
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/components/forms/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:key="`${childOption[valueAttribute]}-${index}-${index2}`"
:value="childOption[valueAttribute]"
:selected="childOption[valueAttribute] === normalizedValue"
:disabled="option.disabled"
:disabled="childOption.disabled"
v-text="childOption[textAttribute]"
/>
</optgroup>
Expand Down Expand Up @@ -156,7 +156,7 @@ export default {
return [
{
[props.valueAttribute]: null,
[props.valueAttribute]: '',
[props.textAttribute]: props.placeholder,
disabled: true
},
Expand All @@ -167,7 +167,7 @@ export default {
const normalizedValue = computed(() => {
const foundOption = normalizedOptionsWithPlaceholder.value.find(option => option.value === props.modelValue)
if (!foundOption) {
return null
return ''
}
return foundOption.value
Expand Down

1 comment on commit eb00439

@vercel
Copy link

@vercel vercel bot commented on eb00439 Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.