mithril-materialized 3.17.0 → 3.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -7264,12 +7264,12 @@
7264
7264
  opacity: 1,
7265
7265
  };
7266
7266
  };
7267
- const formatSelectionSummary = (attrs, selectedOptions, selectedIds, placeholder) => {
7267
+ const formatSelectionSummary = (attrs, selectedLabels, selectedIds, placeholder) => {
7268
7268
  const mode = attrs.summaryMode || 'labels';
7269
7269
  const selectedCount = selectedIds.length;
7270
7270
  const totalCount = attrs.options.filter((option) => !option.disabled).length;
7271
7271
  if (mode === 'labels') {
7272
- return selectedOptions.length > 0 ? selectedOptions.map((o) => o.label || o.id).join(', ') : placeholder;
7272
+ return selectedLabels.length > 0 ? selectedLabels.join(', ') : placeholder;
7273
7273
  }
7274
7274
  const defaultCountLabel = `${selectedCount}/${totalCount} selected`;
7275
7275
  const formattedCount = attrs.countLabel ? attrs.countLabel(selectedCount, totalCount) : defaultCountLabel;
@@ -7423,7 +7423,8 @@
7423
7423
  const shouldInlineLabel = appearance === 'outlined' && !!label;
7424
7424
  const selectedOptionsUnsorted = options.filter((opt) => isSelected(opt.id, selectedIds));
7425
7425
  const selectedOptions = sortOptions(selectedOptionsUnsorted, attrs.sortSelected);
7426
- const triggerValue = formatSelectionSummary(attrs, selectedOptions, selectedIds, placeholder);
7426
+ const selectedLabels = selectedOptions.map((o) => o.label || o.id.toString());
7427
+ const triggerValue = formatSelectionSummary(attrs, selectedLabels, selectedIds, placeholder);
7427
7428
  // Update portal dropdown when inside modal
7428
7429
  if (state.isInsideModal) {
7429
7430
  updatePortalDropdown(attrs, selectedIds, multiple, placeholder);