Skip to content
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

fix(table): 1. null is an object 2.树形结构,支持懒加载 #1046

Merged
merged 3 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/table/EditableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const EditableCell = (props: EditableCellProps) => {
if (!isSame(args[0].value, get(row, col.colKey))) {
outsideAbortEvent?.(...args);
}
// 此处必须在事件执行完成后异步销毁编辑组件,否则会导致事件清楚不及时引起的其他问题
// 此处必须在事件执行完成后异步销毁编辑组件,否则会导致事件清除不及时引起的其他问题
const timer = setTimeout(() => {
setIsEdit(false);
clearTimeout(timer);
Expand Down Expand Up @@ -165,7 +165,7 @@ const EditableCell = (props: EditableCellProps) => {

useEffect(() => {
let val = get(row, col.colKey);
if (typeof val === 'object') {
if (typeof val === 'object' && val !== null) {
val = val instanceof Array ? [...val] : { ...val };
}
setEditValue(val);
Expand Down Expand Up @@ -218,7 +218,6 @@ const EditableCell = (props: EditableCellProps) => {
tips={errorMessage}
{...componentProps}
{...listeners}
// @ts-ignore
value={editValue}
onChange={onEditChange}
/>
Expand Down
Loading