Skip to content

feat(select): add hideSelectedOptions prop #243

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

TotomInc
Copy link
Owner

@TotomInc TotomInc commented Apr 8, 2025

Add hideSelectedOptions prop for multi-select components

Overview

This PR adds a new hideSelectedOptions prop to the Vue Select component that allows controlling whether selected options appear in the dropdown menu when using multi-select mode.

Features

  • Added new hideSelectedOptions boolean prop (default: true)
  • When true (default), selected options are hidden from the dropdown in multi-select mode
  • When false, selected options remain visible in the dropdown
  • Enhanced the option slot with additional context properties (index, isFocused, isSelected, isDisabled)
  • Improved option selection behavior in multi-select mode to toggle options when clicked

Documentation

  • Added documentation for the new prop in docs/props.md
  • Updated slot documentation in docs/slots.md to include the new slot props

Tests

Added comprehensive tests to verify the behavior:

  • Hiding selected options when hideSelectedOptions is true
  • Showing selected options when hideSelectedOptions is false
  • Confirming single-select behavior remains unchanged
  • Verifying deselected options reappear in the dropdown
  • Testing search functionality with hidden options

Related Issues

Closes #233

Copy link

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue3-select-component ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 4:13pm

@TotomInc TotomInc merged commit a2241b6 into master Apr 9, 2025
3 checks passed
@TotomInc TotomInc deleted the feat/hide-selected-options branch May 6, 2025 19:57
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.

Feature request: in multi-selects with closeOnSelect=false, don't remove selected options from the menu
1 participant