Skip to content

Commit

Permalink
feat(InputMenu): handle nullable prop when clearing input
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jan 24, 2024
1 parent 2cb41db commit 5e49fb8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/runtime/components/forms/InputMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:name="name"
:model-value="modelValue"
:disabled="disabled"
:nullable="nullable"
as="div"
:class="ui.wrapper"
@update:model-value="onUpdate"
Expand Down Expand Up @@ -194,6 +195,10 @@ export default defineComponent({
type: Boolean,
default: false
},
nullable: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: null
Expand Down Expand Up @@ -294,6 +299,10 @@ export default defineComponent({
})
const label = computed(() => {
if (!props.modelValue) {
return
}
if (props.valueAttribute) {
const option = props.options.find(option => option[props.valueAttribute] === props.modelValue)
return option ? option[props.optionAttribute] : null
Expand Down

1 comment on commit 5e49fb8

@vercel
Copy link

@vercel vercel bot commented on 5e49fb8 Jan 24, 2024

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:

ui – ./

ui-git-dev-nuxt-js.vercel.app
ui-nuxt-js.vercel.app
ui.nuxt.com

Please sign in to comment.