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