ywana-core8 0.0.973 → 0.0.975
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 +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +5 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/tokenfield.js +7 -2
package/package.json
CHANGED
package/src/html/tokenfield.js
CHANGED
@@ -47,6 +47,11 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
|
|
47
47
|
}
|
48
48
|
|
49
49
|
const tks = Array.isArray(tokens) ? tokens : []
|
50
|
+
const sortedOptions = options ? options.sort((a, b) => {
|
51
|
+
if (!a.label || !b.label) return 0
|
52
|
+
a.label.localeCompare(b.label)
|
53
|
+
}) : null
|
54
|
+
|
50
55
|
return (
|
51
56
|
<div className='tokenField'>
|
52
57
|
<label>{label}</label>
|
@@ -61,7 +66,7 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
|
|
61
66
|
})}
|
62
67
|
|
63
68
|
{options ? (
|
64
|
-
<DropDown onChange={changeDropDown} options={
|
69
|
+
<DropDown onChange={changeDropDown} options={sortedOptions} predictive={true} verbose={false} />
|
65
70
|
) : (
|
66
71
|
<input type='text' value={value} onChange={change} onKeyDown={onEnter} readOnly={readOnly} />)
|
67
72
|
}
|
@@ -81,4 +86,4 @@ const Token = ({ text, onDelete }) => {
|
|
81
86
|
<Icon icon='close' clickable action={onDelete} size="small" />
|
82
87
|
</div>
|
83
88
|
)
|
84
|
-
}
|
89
|
+
}
|