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

[issue] cellRenderer using default Cell component not working #267

Open
davidsx opened this issue Feb 17, 2021 · 0 comments
Open

[issue] cellRenderer using default Cell component not working #267

davidsx opened this issue Feb 17, 2021 · 0 comments

Comments

@davidsx
Copy link

davidsx commented Feb 17, 2021

Hi. I am trying to add some extra class to the td which I use the Cell component and expend the className prop.

However, I cannot resolve the original behaviour on the following simple code:

cellRenderer={(props) => <Cell {...props} />}

A significant mis-behaviour is that the arrow key navigation failure.

After reading along the code, I figure out a possible reason:
In DataCell there is a onKeyUp prop passed to cellRenderer but there are not used in Cell

DataCell.js

    return (
      <CellRenderer
        row={row}
        col={col}
        cell={cell}
        selected={selected}
        editing={editing}
        updated={updated}
        attributesRenderer={attributesRenderer}
        className={className}
        style={widthStyle(cell)}
        onMouseDown={this.handleMouseDown}
        onMouseOver={this.handleMouseOver}
        onDoubleClick={this.handleDoubleClick}
        onContextMenu={this.handleContextMenu}
        onKeyUp={onKeyUp}
      >
        {content}
      </CellRenderer>
    );

Cell.js (missing onKeyUp)

    return (
      <td
        className={className}
        onMouseDown={onMouseDown}
        onMouseOver={onMouseOver}
        onDoubleClick={onDoubleClick}
        onTouchEnd={onDoubleClick}
        onContextMenu={onContextMenu}
        colSpan={colSpan}
        rowSpan={rowSpan}
        style={style}
        {...attributes}
      >
        {this.props.children}
      </td>
    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant