rows does not toggle the rows that do not match the filter; please use select.none a priori for that.
As shown in the example, rows, and selectedRows are internal variable names, used in the implementation; which can be easily renamed inline (See example where selectedRows is renamed to result)
select.toggle(filter)(rows) => [<row>]
Input rows where each filter-matching row is toggled its selected attribute.
There's a single React specific helper that makes it easier to track up/down arrows. The API consists of a single higher order function: select.byArrowKeys({ rows: <rows>, selectedRowIndex: <number>, onSelectRow: (selectedRowIndex) => <any>})(<React element>) => <React element>
If there is a selection (selectedRowIndex), then it triggers onSelectRow with the new selectedRowIndex which you can then use to update your selection state.
How to Use?
The following example illustrates how to use the functionality with a Reactabular based table. Selection is tracked per row to comply with Reactabular's strict shouldComponentUpdate. This allows it to tell apart the rows that have changed while maintaining good performance.
You can select a row by clicking in the following example. If there's a selection, you can move up and down using the arrow keys.
/*import React from 'react';import classnames from 'classnames';import cloneDeep from 'lodash/cloneDeep';import find from 'lodash/find';import findIndex from 'lodash/findIndex';import { compose } from 'redux';import * as Table from 'reactabular-table';import * as select from 'selectabular';*/const rows = [ { id: 100, name: 'Adam', age: 55 }, { id: 102, name: 'Joe', age: 12 }, { id: 101, name: 'Brian',