diff --git a/packages/react-data-grid/src/index.js b/packages/react-data-grid/src/index.js index eb86dc431a..4fe7014661 100644 --- a/packages/react-data-grid/src/index.js +++ b/packages/react-data-grid/src/index.js @@ -1,9 +1,10 @@ const Grid = require('./ReactDataGrid'); import RowComparer from './RowComparer'; import RowsContainer from './RowsContainer'; +import Cell from './Cell'; module.exports = Grid; module.exports.Row = require('./Row'); -module.exports.Cell = require('./Cell'); +module.exports.Cell = Cell; module.exports.HeaderCell = require('./HeaderCell'); module.exports.RowComparer = RowComparer; module.exports.EmptyChildRow = require('./EmptyChildRow'); diff --git a/packages/react-data-grid/src/masks/InteractionMasks.js b/packages/react-data-grid/src/masks/InteractionMasks.js index 1a3c968dc7..729bed599f 100644 --- a/packages/react-data-grid/src/masks/InteractionMasks.js +++ b/packages/react-data-grid/src/masks/InteractionMasks.js @@ -18,6 +18,7 @@ import { } from '../utils/SelectedCellUtils'; import isFunction from '../utils/isFunction'; import * as AppConstants from '../AppConstants'; +import * as columnUtils from '../ColumnUtils'; import * as keyCodes from '../KeyCodes'; import { CellNavigationMode, EventTypes } from '../constants'; @@ -317,7 +318,7 @@ class InteractionMasks extends React.Component { isCellWithinBounds = ({ idx, rowIdx }) => { const { columns, rowsCount } = this.props; - return rowIdx >= 0 && rowIdx < rowsCount && idx >= 0 && idx < columns.length; + return rowIdx >= 0 && rowIdx < rowsCount && idx >= 0 && idx < columnUtils.getSize(columns); }; isGridSelected = () => { @@ -344,7 +345,7 @@ class InteractionMasks extends React.Component { selectLastCell = () => { const { rowsCount, columns } = this.props; - this.selectCell({ rowIdx: rowsCount - 1, idx: columns.length - 1 }); + this.selectCell({ rowIdx: rowsCount - 1, idx: columnUtils.getSize(columns) - 1 }); }; selectCell = (cell, openEditor) => {