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 react object render #133

Merged
merged 1 commit into from
Jun 4, 2024
Merged
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
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