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.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +6 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +6 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/tokenfield.js +9 -3
package/dist/index.cjs
CHANGED
@@ -2662,8 +2662,11 @@ var TokenField = function TokenField(_ref) {
|
|
2662
2662
|
setValue(value);
|
2663
2663
|
}
|
2664
2664
|
function changeDropDown(fid, value) {
|
2665
|
-
var
|
2666
|
-
if (
|
2665
|
+
var valueIsNotEmpty = value && value.length > 0;
|
2666
|
+
if (valueIsNotEmpty) {
|
2667
|
+
var next = Array.isArray(tokens) ? tokens.concat(value) : [value];
|
2668
|
+
if (onChange) onChange(id, next);
|
2669
|
+
}
|
2667
2670
|
setValue('');
|
2668
2671
|
}
|
2669
2672
|
function onEnter(event) {
|
@@ -2686,7 +2689,7 @@ var TokenField = function TokenField(_ref) {
|
|
2686
2689
|
var sortedOptions = options ? options.toSorted(function (a, b) {
|
2687
2690
|
if (!a.label || !b.label) return 0;
|
2688
2691
|
try {
|
2689
|
-
return a.label
|
2692
|
+
return a.label.localeCompare(b.label);
|
2690
2693
|
} catch (error) {
|
2691
2694
|
console.log('Error sorting options', error, a, b);
|
2692
2695
|
return 0;
|