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): allows to clear search query on close #968

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

DarkGhostHunter
Copy link
Contributor

@DarkGhostHunter DarkGhostHunter commented Nov 15, 2023

πŸ”— Linked issue

Resolves #883

❓ 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

Currently, <USelectMenu> doesn't clear the search query when an option is selected, or when the menu is closed by selection.

This allows to clear it when the menu is closed, by either manually closing it or selecting an option, by using the attribute clear-search-on-close.

πŸ“ Checklist

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

Copy link

vercel bot commented Nov 15, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Nov 21, 2023 5:57pm

@DarkGhostHunter DarkGhostHunter changed the title feat(SelectMenu): allows to clear search query on close or update feat(SelectMenu): allows to clear search query on close Nov 17, 2023
@DarkGhostHunter
Copy link
Contributor Author

I reworked this PR to only clear the search query on close. In other words, the search input becomes empty when:

  • The user closes the menu manually
  • The user selects an option, closing the menu.

When the user selects multiple options, the menu doesn't close. This makes clear on update unnecessary. Also, it's not expected the option will change while the menu is open, so there is no need to clear on update.

@benjamincanac
Copy link
Member

Would you mind explaining the difference with #890? I now have to choose between both πŸ˜…

@DarkGhostHunter
Copy link
Contributor Author

Would you mind explaining the difference with #890? I now have to choose between both πŸ˜…

Sorry! When I made it I just oversaw it on the pulls.

The main difference is that the search query is kept as-is by default, where as #890 does not (clears on close by default). But #890 adds a global config to enable or disable this. I'll add that too.

@benjamincanac benjamincanac merged commit 11ccbbb into nuxt:dev Nov 21, 2023
2 checks passed
@DarkGhostHunter DarkGhostHunter deleted the feat/clear-on-select-close branch November 21, 2023 18:02
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.

SelectMenu ability to clear search string
2 participants