Skip to content

Commit

Permalink
refactor: renaming prop name
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed May 7, 2024
1 parent 9b43b7f commit dd4096d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Combobox/Combobox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('given default Combobox', () => {
})

it('should not reset searchTerm when close', async () => {
await wrapper.setProps({ resetSearchTermOnHide: false, key: 'key' })
await wrapper.setProps({ resetSearchTermOnBlur: false, key: 'key' })
const input = wrapper.find('input')
input.element.value = 'Testing'
await input.trigger('keydown', { key: 'Escape' })
Expand Down
8 changes: 4 additions & 4 deletions packages/radix-vue/src/Combobox/ComboboxRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export interface ComboboxRootProps<T = AcceptableValue> extends PrimitiveProps {
filterFunction?: (val: ArrayOrWrapped<T>, term: string) => ArrayOrWrapped<T>
/** The display value of input for selected item. Does not work with `multiple`. */
displayValue?: (val: T) => string
/** Whether to reset the searchTerm when the Combobox closes
/** Whether to reset the searchTerm when the Combobox input blurred
* @defaultValue `true`
*/
resetSearchTermOnHide?: boolean
resetSearchTermOnBlur?: boolean
}
</script>

Expand All @@ -82,7 +82,7 @@ import isEqual from 'fast-deep-equal'
const props = withDefaults(defineProps<ComboboxRootProps<T>>(), {
open: undefined,
resetSearchTermOnHide: true,
resetSearchTermOnBlur: true,
})
const emit = defineEmits<ComboboxRootEmits<T>>()
Expand Down Expand Up @@ -133,7 +133,7 @@ async function onOpenChange(val: boolean) {
}
else {
isUserInputted.value = false
if (props.resetSearchTermOnHide)
if (props.resetSearchTermOnBlur)
resetSearchTerm()
}
}
Expand Down

0 comments on commit dd4096d

Please sign in to comment.