eui
eui copied to clipboard
[EuiBasicTable] Option to make selected table items controlled from a parent component
Related issues: https://github.com/elastic/kibana/issues/136616
Summary
Currently, EuiBasicTable doesn't support the table selection to be controlled from a parent component. That means if there's a global state that keeps track of selected table rows, all changes to that global state and the local EUI table state should be synchronized manually using the imperative setSelection() API. That makes state synchronization logic pretty complicated and error-prone. For example, here's how the selection state gets synchronized in Security Solution.
It would be nice to have an option to fully control selected table rows from the outside in a declarative way. Something like:
<EuiBasicTable
selection={{
selected: selectedItems
}}
/>