ywana-core8 0.0.978 → 0.0.979
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 +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +4 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +4 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/tokenfield.js +3 -3
package/package.json
CHANGED
package/src/html/tokenfield.js
CHANGED
@@ -7,7 +7,7 @@ import './tokenfield.css'
|
|
7
7
|
/**
|
8
8
|
* Token Field
|
9
9
|
*/
|
10
|
-
export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange }) => {
|
10
|
+
export const TokenField = ({ id, label, tokens = [], readOnly, options, predictive=true, onChange }) => {
|
11
11
|
|
12
12
|
const [value, setValue] = useState()
|
13
13
|
|
@@ -50,7 +50,7 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
|
|
50
50
|
const sortedOptions = options ? options.toSorted((a, b) => {
|
51
51
|
if (!a.label || !b.label) return 0
|
52
52
|
try {
|
53
|
-
return a.label.localeCompare(b.label)
|
53
|
+
return a.label+"".localeCompare(b.label+"")
|
54
54
|
} catch (error) {
|
55
55
|
console.log('Error sorting options', error, a, b)
|
56
56
|
return 0
|
@@ -71,7 +71,7 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
|
|
71
71
|
})}
|
72
72
|
|
73
73
|
{options ? (
|
74
|
-
<DropDown onChange={changeDropDown} options={sortedOptions} predictive={
|
74
|
+
<DropDown onChange={changeDropDown} options={sortedOptions} predictive={predictive} verbose={false} />
|
75
75
|
) : (
|
76
76
|
<input type='text' value={value} onChange={change} onKeyDown={onEnter} readOnly={readOnly} />)
|
77
77
|
}
|