Skip to content

Commit

Permalink
fix(combobox): rename clear to reset on select
Browse files Browse the repository at this point in the history
  • Loading branch information
hrynevychroman committed Aug 31, 2024
1 parent b15966c commit c2733af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/content/meta/ComboboxRoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
'default': 'true'
},
{
'name': 'clearSearchTermOnSelect',
'description': '<p>Whether to clear the searchTerm when the Combobox value is selected</p>\n',
'name': 'resetSearchTermOnSelect',
'description': '<p>Whether to reset the searchTerm when the Combobox value is selected</p>\n',
'type': 'boolean',
'required': false,
'default': 'true'
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 @@ -76,10 +76,10 @@ export interface ComboboxRootProps<T = AcceptableValue> extends PrimitiveProps {
*/
resetSearchTermOnBlur?: boolean
/**
* Whether to clear the searchTerm when the Combobox value is selected
* Whether to reset the searchTerm when the Combobox value is selected
* @defaultValue `true`
*/
clearSearchTermOnSelect?: boolean
resetSearchTermOnSelect?: boolean
}
</script>

Expand All @@ -94,7 +94,7 @@ import isEqual from 'fast-deep-equal'
const props = withDefaults(defineProps<ComboboxRootProps<T>>(), {
open: undefined,
resetSearchTermOnBlur: true,
clearSearchTermOnSelect: true,
resetSearchTermOnSelect: true,
})
const emit = defineEmits<ComboboxRootEmits<T>>()
Expand Down Expand Up @@ -218,7 +218,7 @@ const stringifiedModelValue = computed(() => JSON.stringify(modelValue.value))
// nextTick() are required in the following watchers as we are waiting for DOM element to be mounted first the only apply following logic
watch(stringifiedModelValue, async () => {
if (!props.clearSearchTermOnSelect)
if (!props.resetSearchTermOnSelect)
return
await nextTick()
Expand Down

0 comments on commit c2733af

Please sign in to comment.