@@ -43,16 +43,20 @@ export default class TimetableGrid extends Component {
4343 handleKeyPress = ( evt ) => {
4444 const { activeCell, setActiveCell, scrollToColumn, scrollToRow} = this . props
4545 switch ( evt . keyCode ) {
46+ case 8 : // DELETE
47+ // TODO: add delete cell value
48+ // updateCellValue('', rowIndex, `${scrollToRow}.${col.key}`)
49+ break
50+ case 9 : // tab
51+ this . offsetScrollCol ( evt . shiftKey ? - 1 : 1 )
52+ evt . preventDefault ( )
53+ break
4654 case 13 : // Enter
4755 if ( ! activeCell ) {
4856 return setActiveCell ( `${ scrollToRow } -${ scrollToColumn } ` )
4957 } else {
5058 return setActiveCell ( null )
5159 }
52- case 8 : // DELETE
53- // TODO: add delete cell value
54- // updateCellValue('', rowIndex, `${scrollToRow}.${col.key}`)
55- break
5660 case 67 :
5761 // handle copy
5862 if ( evt . ctrlKey ) {
@@ -166,27 +170,26 @@ export default class TimetableGrid extends Component {
166170 const isInvalid = isTimeFormat ( col . type ) && val >= 0 && val < previousValue && val !== null
167171 return (
168172 < EditableCell
169- key = { key }
170- onClick = { updateScroll }
171- // duplicateLeft={(evt) => updateCellValue(previousValue, rowIndex, `${rowIndex}.${col.key}`)}
173+ cellRenderer = { getCellRenderer }
174+ column = { col }
175+ columnIndex = { columnIndex } // pass original index to prevent issues with updateScroll/scrollsync
176+ data = { val }
172177 handlePastedRows = { this . handlePastedRows }
178+ hideDepartureTimes = { hideDepartureTimes }
173179 invalidData = { isInvalid }
174180 isEditing = { isEditing }
175- isSelected = { rowIsChecked }
176181 isFocused = { isFocused }
177- hideDepartureTimes = { hideDepartureTimes }
182+ isSelected = { rowIsChecked }
183+ key = { key }
178184 lightText = { col . type === 'DEPARTURE_TIME' }
185+ offsetScrollCol = { this . offsetScrollCol }
186+ onChange = { this . _onCellChange }
187+ onClick = { updateScroll }
188+ onStopEditing = { this . handleEndEditing }
179189 placeholder = { col . placeholder }
180190 renderTime = { isTimeFormat ( col . type ) }
181- cellRenderer = { getCellRenderer }
182- data = { val }
183- column = { col }
184- columnIndex = { columnIndex } // pass original index to prevent issues with updateScroll/scrollsync
185191 rowIndex = { rowIndex }
186192 style = { style }
187- onStopEditing = { this . handleEndEditing }
188- onChange = { this . _onCellChange }
189- offsetScrollCol = { this . offsetScrollCol }
190193 />
191194 )
192195 }
0 commit comments