ywana-core8 0.0.979 → 0.0.981

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
@@ -2655,8 +2655,11 @@
2655
2655
  setValue(value);
2656
2656
  }
2657
2657
  function changeDropDown(fid, value) {
2658
- var next = Array.isArray(tokens) ? tokens.concat(value) : [value];
2659
- if (onChange) onChange(id, next);
2658
+ var valueIsNotEmpty = value && value.length > 0;
2659
+ if (valueIsNotEmpty) {
2660
+ var next = Array.isArray(tokens) ? tokens.concat(value) : [value];
2661
+ if (onChange) onChange(id, next);
2662
+ }
2660
2663
  setValue('');
2661
2664
  }
2662
2665
  function onEnter(event) {
@@ -2679,7 +2682,7 @@
2679
2682
  var sortedOptions = options ? options.toSorted(function (a, b) {
2680
2683
  if (!a.label || !b.label) return 0;
2681
2684
  try {
2682
- return a.label + "".localeCompare(b.label + "");
2685
+ return a.label.localeCompare(b.label);
2683
2686
  } catch (error) {
2684
2687
  console.log('Error sorting options', error, a, b);
2685
2688
  return 0;