I would like to navigate @blueprintjs/table
using arrow/tab keys.
I followed these document, but couldn't find any solution.
Could anyone help with a sample code / solution.
My current component is as follows.
import React, { Component } from 'react';
import { EditableCell, Column, Table } from "@blueprintjs/table";
class TestComponent extends Component {
constructor(props) {
super(props);
this.renderCell = this.renderCell.bind(this);
}
renderCell (rowIndex, columnIndex) {
const value = null;
return (
<EditableCell alue={value == null ? "" : value}/>
);
}
render() {
const columns = ["Please", "Rename", "Me"].map((_ , index) => {
return (
<Column key={index} cellRenderer={this.renderCell} enableFocus="true"/>
);
});
return (
<Table numRows={7} enableFocus="true">{columns}</Table>
);
}
}
export default TestComponent;
I got the solution, so answering my own question.
we should use
enableFocusedCell="true"
for the Table component, to enable navigation using arrow/tab keys.Please find the sample code below.
first import css
import "@blueprintjs/table/lib/css/table.css";
then create a component like follows