tenjin-ui-kit 0.2.63 → 0.2.64
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.
|
@@ -49,11 +49,11 @@ var InputWithChip = function InputWithChip(_ref) {
|
|
|
49
49
|
}
|
|
50
50
|
}, [chips]);
|
|
51
51
|
var handleAddChip = function handleAddChip(event) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var newValue = typeof
|
|
52
|
+
if (event.key === 'Enter' || event.keyCode === 188 || event.keyCode === 9 || event.type === 'blur') {
|
|
53
|
+
var _value = event.target.value;
|
|
54
|
+
var newValue = typeof _value === 'string' ? _value.replace(',', '') : _value;
|
|
55
55
|
setChips([].concat(_toConsumableArray(chips), [newValue]));
|
|
56
|
-
|
|
56
|
+
onChange([].concat(_toConsumableArray(chips), [newValue]));
|
|
57
57
|
event.target.value = '';
|
|
58
58
|
event.target.parentNode.querySelector('input').value = '';
|
|
59
59
|
}
|
|
@@ -80,10 +80,13 @@ var InputWithChip = function InputWithChip(_ref) {
|
|
|
80
80
|
required: isRequired
|
|
81
81
|
}, label), /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({}, rest, {
|
|
82
82
|
required: isRequired,
|
|
83
|
-
disabled: isDisabled
|
|
84
|
-
// value={value}
|
|
85
|
-
,
|
|
83
|
+
disabled: isDisabled,
|
|
86
84
|
onKeyDown: handleAddChip,
|
|
85
|
+
onBlur: function onBlur(e) {
|
|
86
|
+
if (e.target.value !== '') {
|
|
87
|
+
handleAddChip(e);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
87
90
|
style: {
|
|
88
91
|
backgroundColor: isDisabled && '#E7E7E7'
|
|
89
92
|
},
|