Skip to content

Commit

Permalink
fix react object render
Browse files Browse the repository at this point in the history
  • Loading branch information
dufoli committed Jun 4, 2024
1 parent 79d44ba commit cdfe2d8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions addon/data-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,20 +683,28 @@ class ScrollTableCell extends React.Component {
}
render() {
let {cell, rowHeight, colWidth, previousCell} = this.props;
let cellLabel = cell.label?.toString();
if (cellLabel == "[object Object]") {
cellLabel = "";
}
let cellDataEditValue = cell.dataEditValue?.toString();
if (cellDataEditValue == "[object Object]") {
cellDataEditValue = "";
}
let className = "scrolltable-cell";
if (cell.isEditing){
if (previousCell != null && previousCell.dataEditValue != cell.dataEditValue) {
className += " scrolltable-cell-diff";
}
return h("td", {className, style: {minWidth: colWidth + "px", height: rowHeight + "px"}},
h("textarea", {value: cell.dataEditValue, onChange: this.onDataEditValueInput}),
h("textarea", {value: cellDataEditValue, onChange: this.onDataEditValueInput}),
h("a", {href: "about:blank", onClick: this.onCancelEdit, className: "undo-button"}, "\u21B6"));
} else {
if (previousCell != null && previousCell.label != cell.label) {
className += " scrolltable-cell-diff";
}
return h("td", {className, style: {minWidth: colWidth + "px", height: rowHeight + "px"}},
cell.linkable ? h("a", {href: "about:blank", title: "Show all data", onClick: this.onClick, onDoubleClick: this.onTryEdit}, cell.label?.toString()) : h("div", {onDoubleClick: this.onTryEdit}, cell.label?.toString()),
cell.linkable ? h("a", {href: "about:blank", title: "Show all data", onClick: this.onClick, onDoubleClick: this.onTryEdit}, cellLabel) : h("div", {onDoubleClick: this.onTryEdit}, cellLabel),
cell.showMenu ? h("div", {className: "pop-menu"},
cell.links.map((l, idx) => {
let arr = [];
Expand Down

0 comments on commit cdfe2d8

Please sign in to comment.