Skip to content
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

Closed
wants to merge 0 commits into from
Closed

feat(SelectMenu): add clearable prop to clear the seleted value #1637

wants to merge 0 commits into from

Conversation

NMTuan
Copy link

@NMTuan NMTuan commented Apr 8, 2024

πŸ”— Linked issue

Resolves #1057

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add the clearable prop for SelectMenu, and you can set clearableIcon 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

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@NMTuan
Copy link
Author

NMTuan commented Apr 8, 2024

I changed the docs file, but it looks unchanged? why?
https://ui-e0q9c1lhx-nuxt-js.vercel.app/components/select-menu
image

Copy link
Member

@NMTuan You need to switch to the nuxt/ui-edge package.

@NMTuan
Copy link
Author

NMTuan commented Apr 9, 2024

I saw the document content through this link https://ui-e0q9c1lhx-nuxt-js.vercel.app/dev/components/select-menu#clearable

I don't know nuxt/ui-edge means,hope it won't affect this pull request :)

Copy link
Member

On the top-left corner, you can switch to the dev package:
CleanShot 2024-04-09 at 10.05.15@2x.png

@hamonCordova
Copy link

There is a prevision for a realease date?

@NMTuan
Copy link
Author

NMTuan commented May 15, 2024

What else do I need to do?

@hamonCordova
Copy link

I think this PR need to be merged ASAP. This feature is really important

@hamonCordova
Copy link

When this will be released???

@hamonCordova
Copy link

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'
Copy link
Member

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'
Copy link
Member

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:

Suggested change
default: 'i-heroicons-x-mark-20-solid'
default: () => configMenu.default.clearableIcon

---
::

### ClearableIcon
Copy link
Member

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?

Suggested change
### ClearableIcon

@NMTuan NMTuan closed this Jul 23, 2024
@NMTuan
Copy link
Author

NMTuan commented Jul 23, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Clear Button to USelectMenu
3 participants