1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect - #5
Merged
gajendrajena merged 3 commits intoMar 5, 2026
Conversation
…lect
- `selectize.js` — Added **showSelectedCount** to defaults, a **selectedCountText** computed property ("N selected"), toggle-on-click behavior for options (click selected option to deselect), and forced hideSelected: false so selected options stay visible in the dropdown.
- `index.js` — Updated the template:
- `Input area`: Shows a blue badge with the count (e.g. "2 selected") on the left side, hides individual tags, and keeps the placeholder visible.
- **Dropdown options**: Adds a ✓ tick mark before selected options.
- `selectra.css` — Added styles for .selectra-selected-count (badge), .selectra-option-tick (checkmark), and .selectra-option updated to flex layout.
- `index.d.ts` — Added **showSelectedCount** to config and **selectedCountText** to instance types.
- `index.html` — Added a "Multi Select with Count" demo section.
- **Version**: bumped from 1.0.5 → 1.1.0 in `package.json`
Collaborator
Author
This comment was marked as resolved.
This comment was marked as resolved.
- **Badge always visible** — removed the `items.length > 0` condition from `x-show` in `index.js`, so the badge shows even with 0 selections. - **Count shows 0** — simplified selectedCountText in `selectize.js` to always return the count (including 0).
gajendrajena
deleted the
1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect
branch
March 5, 2026 10:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


#1
selectize.js— Added showSelectedCount to defaults, a selectedCountText computed property ("N selected"), toggle-on-click behavior for options (click selected option to deselect), and forced hideSelected: false so selected options stay visible in the dropdown.index.js— Updated the template:Input area: Shows a blue badge with the count (e.g. "2 selected") on the left side, hides individual tags, and keeps the placeholder visible.selectra.css— Added styles for .selectra-selected-count (badge), .selectra-option-tick (checkmark), and .selectra-option updated to flex layout.index.d.ts— Added showSelectedCount to config and selectedCountText to instance types.index.html— Added a "Multi Select with Count" demo section.package.json