Skip to content

Commit

Permalink
fix(InputMenu/SelectMenu): fast-deep-equal import
Browse files Browse the repository at this point in the history
Resolves #2488
  • Loading branch information
benjamincanac committed Oct 29, 2024
1 parent fc2015b commit 309e52f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/InputMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export interface InputMenuSlots<T> {
import { computed, ref, toRef, onMounted } from 'vue'
import { ComboboxRoot, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits } from 'radix-vue'
import { defu } from 'defu'
import isEqual from 'fast-deep-equal'
import * as isEqual from 'fast-deep-equal'
import { reactivePick } from '@vueuse/core'
import { useAppConfig } from '#imports'
import { useButtonGroup } from '../composables/useButtonGroup'
Expand Down Expand Up @@ -175,7 +175,7 @@ const ui = computed(() => inputMenu({
}))
function displayValue(value: AcceptableValue): string {
const item = items.value.find(item => props.valueKey ? isEqual(get(item as Record<string, any>, props.valueKey as string), value) : isEqual(item, value))
const item = items.value.find(item => props.valueKey ? isEqual.default(get(item as Record<string, any>, props.valueKey as string), value) : isEqual.default(item, value))
return item && (typeof item === 'object' ? get(item, props.labelKey as string) : item)
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/SelectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export interface SelectMenuSlots<T> {
import { computed, toRef } from 'vue'
import { ComboboxRoot, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, useForwardPropsEmits } from 'radix-vue'
import { defu } from 'defu'
import isEqual from 'fast-deep-equal'
import * as isEqual from 'fast-deep-equal'
import { reactivePick } from '@vueuse/core'
import { useAppConfig } from '#imports'
import { useButtonGroup } from '../composables/useButtonGroup'
Expand Down Expand Up @@ -168,7 +168,7 @@ function displayValue(value: T | T[]): string {
return value.map(v => displayValue(v)).join(', ')
}
const item = items.value.find(item => props.valueKey ? isEqual(get(item as Record<string, any>, props.valueKey as string), value) : isEqual(item, value))
const item = items.value.find(item => props.valueKey ? isEqual.default(get(item as Record<string, any>, props.valueKey as string), value) : isEqual.default(item, value))
return item && (typeof item === 'object' ? get(item, props.labelKey as string) : item)
}
Expand Down

0 comments on commit 309e52f

Please sign in to comment.