Skip to content

1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect - #5

Merged
gajendrajena merged 3 commits into
masterfrom
1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect
Mar 5, 2026
Merged

1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect#5
gajendrajena merged 3 commits into
masterfrom
1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect

Conversation

@BrijeshSajeev

Copy link
Copy Markdown
Collaborator

#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.
  • 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

…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`
@BrijeshSajeev

Copy link
Copy Markdown
Collaborator Author
image image

@gajendrajena

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
gajendrajena merged commit 8556fa5 into master Mar 5, 2026
2 checks passed
@gajendrajena
gajendrajena deleted the 1-add-the-capability-of-showing-number-of-selected-items-in-a-multiselect branch March 5, 2026 10:00
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.

2 participants