展开agPopupSelectCellEditor时不会触发onCellClicked事件

时间:2019-10-26 13:56:37

标签: reactjs ag-grid ag-grid-react

我的目标是在每个单元格上都单击编辑器。直到用户在“颜色”下拉菜单中扩展选项为止,所有工作均按预期进行。每次单击列都会触发onCellClicked事件。扩展颜色可以防止在单击其他单元格时触发onCellClicked。

  // This is my column definitions
  const colors = ["orange", "blue", "green", "purple", "red"]
  {
    field: "color",
    headerName: "Color",
    editable: true,
    cellEditor: "agPopupSelectCellEditor",
    cellEditorParams: { values: colors }
  }

  // When clicked start editing cell
  const onCellClicked = ({ rowIndex, column: { colId } }) => {
    console.log("onCellClicked");
    api.startEditingCell({ rowIndex, colKey: colId });
  };
  ...
   <AgGridReact
     ...
     onCellClicked={onCellClicked}
     ...
    />

Full example on stackblitz

Gif illustrating this issue

我知道这是特定于我的环境的。但不确定是什么阻止了此事件。

  • 浏览器:Chrome 75.0.3770.142版(正式版本)(64位)
  • 操作系统:Ubuntu 18.04.2 LTS
  • ag-grid-community21.2.1
  • ag-grid-enterprise21.2.1
  • ag-grid-react21.2.2
  • 知情1.10.7
  • react16.10.2
  • react-dom16.10.2
  • react-loadable5.5.0

0 个答案:

没有答案