react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

Keyboard navigation does not work if hideSelectColumn is true

Open stephanebarbey opened this issue 9 years ago • 3 comments

(Using 3.1.1:) If my table has the property hideSelectColumn, then the cell navigation with keyboard does not work any more, in that the tab key will sometime jump columns (usually from the first column to the third one).

I have included (bad quality) animated gifs that shows the behaviour. The only change between the two examples is the "hideSelectColumn" being commented out.

render() {
   const { data, columns, showFilter, selectionMode } = this.props;

   const selectRow = (selectionMode === 'none') ? {}
   : {
     mode: (selectionMode === 'single') ? 'radio' : 'checkbox',
     clickToSelect: true,
     hideSelectColumn: (selectionMode === 'single'),
     onSelect: this.onRowSelect,
     bgColor: 'orange'
   };

   const tableHeaderColumns = columns ? columns.map((col) => {
     return (
       <TableHeaderColumn
         id={col.key}
         key={col.key}
         dataField={col.key}
         dataSort
         dataFormat={col.dataFormat}
         isKey={col.isKey}
         hidden={col.hidden}
         filter={showFilter ? { type: 'TextFilter', placeholder: 'Please enter a value', delay: 500 } : null}
       >
         {col.name}
       </TableHeaderColumn>
     );
   }) : [];

   const cellEdit = {
     mode: 'click', // click cell to edit
     blurToSave: true,
   };

   return (
     <BootstrapTable
       ref={(c) => { this.table = c; }}
       data={data}
       striped
       condensed
       hover
       insertRow
       deleteRow
       search
       exportCSV
       bordered={Boolean(false)}
       keyBoardNav={Boolean(true)}
       selectRow={selectRow}
       cellEdit={cellEdit}
     >
       {tableHeaderColumns}
     </BootstrapTable>
   );
 }

Example without hideSelectColumn:

workingexample

Example with hideSelectColumn: notworkingexample

stephanebarbey avatar Mar 15 '17 12:03 stephanebarbey

sorry for lately reply cause of my busy work.. I'll check it our and fix it as soon as possible, thanks

AllenFang avatar Mar 18 '17 13:03 AllenFang

Fixed on v3.1.6, please have a look on it, thanks :)

AllenFang avatar Apr 03 '17 05:04 AllenFang

I will! Thanks.

stephanebarbey avatar Apr 03 '17 05:04 stephanebarbey