-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(SelectMenu): add clearable prop to clear the seleted value #1637
Conversation
I changed the docs file, but it looks unchanged? why? |
@NMTuan You need to switch to the |
I saw the document content through this link https://ui-e0q9c1lhx-nuxt-js.vercel.app/dev/components/select-menu#clearable I don't know |
There is a prevision for a realease date? |
What else do I need to do? |
I think this PR need to be merged ASAP. This feature is really important |
When this will be released??? |
It's a must have. When it will be released? |
@@ -440,11 +451,16 @@ export default defineComponent({ | |||
}) | |||
|
|||
const trailingIconClass = computed(() => { | |||
let clearableClass = '' | |||
if (props.clearable && (Array.isArray(props.modelValue) ? props.modelValue.length : props.modelValue)) { | |||
clearableClass = 'hover:bg-gray-500 dark:hover:bg-gray-400 cursor-pointer pointer-events-auto' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should come from the theme config and not hard-coded in the component using ui.value.clearableIcon
for example.
}, | ||
clearableIcon: { | ||
type: String, | ||
default: 'i-heroicons-x-mark-20-solid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should default from the config:
default: 'i-heroicons-x-mark-20-solid' | |
default: () => configMenu.default.clearableIcon |
--- | ||
:: | ||
|
||
### ClearableIcon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this title?
### ClearableIcon |
Sorry, there are some problems with my local environment and network connection. I can't start the local development environment. Can someone take over the subsequent development? |
π Linked issue
Resolves #1057
β Type of change
π Description
Add the
clearable
prop for SelectMenu, and you can setclearableIcon
prop to change the clearable icon.When the SelectMenu has one or more values, the clear button will appear. click the button clear the values.
π Checklist