-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SelectTree 搜索输入框在输入值时候失焦问题 #1491
Labels
Comments
删除第一次的关键词,再次搜索关键词后,选择节点会出现报错 Uncaught TypeError: Cannot convert undefined or null to object
at util.js:528
at Array.map (<anonymous>)
at clearReturnData (util.js:527)
at checkedEvents (SelectTreeHook.js:427)
at onChange (TreeNode.js:85)
at Checkbox.js:52
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
at invokeGuardedCallback (react-dom.development.js:292)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:306) 对应源码位置, node is undefined var clearReturnData = function clearReturnData(arg) {
arg = _lodash["default"].cloneDeep(arg);
if (arg instanceof Array) {
arg = arg.map(function (node) {
delete node.ancestors; // node is undefined
delete node.pId;
return node;
});
} else {
delete arg.ancestors;
delete arg.pId;
}
return arg;
}; |
GleanCoder1116
added a commit
that referenced
this issue
Jan 5, 2021
GleanCoder1116
added a commit
that referenced
this issue
Jan 6, 2021
fix: SelectTree: 微调异步多选报错问题修复 #1491
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug 描述
SelectTree 异步搜索无法实现中文搜索
参考
重现步骤:
预期行为
能够支持中文搜索
可重现环境:
代码如下:
`
import React from "react"
import SelectTree from "@hi-ui/hiui/es/select-tree"
class Demo extends React.Component {
render() {
return (
<SelectTree
clearable
dataSource={(key) => {
return {
method: "GET",
key: "id",
params: { pId: key },
url: "http://my-json-server.typicode.com/hiui-group/db/fulldata",
transformResponse: (res) => {
return res.map((r) => {
return {
...r,
id: r.code || r.id,
title: r.name || r.title
}
})
}
}
}}
/>
)
}
}
export default Demo
`
补充
在正常的过滤以及筛选功能中也是同样情况
The text was updated successfully, but these errors were encountered: