x-ui-design 0.2.84 → 0.2.86
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.esm.js +11 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +41 -34
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2988,20 +2988,19 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2988
2988
|
return;
|
|
2989
2989
|
}
|
|
2990
2990
|
setSearchQuery('');
|
|
2991
|
-
|
|
2991
|
+
let inputContainer = selectRef.current?.querySelector(`[id='${prefixCls}-search-tag-input']`);
|
|
2992
|
+
if (!inputContainer) {
|
|
2993
|
+
inputContainer = selectRef.current?.querySelector("[content-editable='plaintext-only']");
|
|
2994
|
+
}
|
|
2992
2995
|
if (inputContainer) {
|
|
2993
2996
|
inputContainer.innerText = '';
|
|
2994
2997
|
}
|
|
2995
|
-
}, [autoClearSearchValue]);
|
|
2998
|
+
}, [autoClearSearchValue, prefixCls]);
|
|
2996
2999
|
useEffect(() => {
|
|
2997
3000
|
const handleClickOutside = event => {
|
|
2998
3001
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
2999
3002
|
setIsOpen(open);
|
|
3000
|
-
|
|
3001
|
-
handleClearInputValue();
|
|
3002
|
-
} else {
|
|
3003
|
-
setSearchQuery('');
|
|
3004
|
-
}
|
|
3003
|
+
handleClearInputValue();
|
|
3005
3004
|
}
|
|
3006
3005
|
};
|
|
3007
3006
|
document.addEventListener('mousedown', handleClickOutside);
|
|
@@ -3127,6 +3126,11 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3127
3126
|
}, [getPopupContainer]);
|
|
3128
3127
|
const extractedOptions = children ? (Array.isArray(children) ? children : [children]).filter(e => e).map(child => child.props) : options;
|
|
3129
3128
|
const filteredOptions = extractedOptions.filter(option => {
|
|
3129
|
+
console.info({
|
|
3130
|
+
searchQuery,
|
|
3131
|
+
option,
|
|
3132
|
+
optionFilterProp
|
|
3133
|
+
});
|
|
3130
3134
|
if (typeof filterOption === 'function') {
|
|
3131
3135
|
return filterOption(searchQuery, option);
|
|
3132
3136
|
}
|