I’ve popped this in here as its probably the closest category. It’s very disappointing to see how poorly written the documentation is for Polaris when its a requirement for BFS.
I’m currently trying to implement the ‘Select X+ in this store’ in the IndexTable. Basically after selecting the entire page of data, you can then display ‘Select all’. I’ve managed to get it to this point (after sifting through the source code) but I’m still at a bit of a road block where once you’ve checked the select all checkbox, I’m unable to uncheck it. It works when unchecking a single row
Using what I understand from the source code, I’ve used the following for onSelectionChange
on the IndexTable
:
onSelectionChange={(selectionType, isSelecting, selection, position) => {
switch (selectionType) {
case 'all':
handleSelectionChange(
selectionType,
isSelecting,
allProducts.map((product) => product.id)
);
break;
case 'page':
handleSelectionChange(
selectionType,
isSelecting,
paginatedProducts.map((product) => product.id)
);
break;
case 'multi':
handleSelectionChange(selectionType, isSelecting, selection);
break;
case 'single':
handleSelectionChange(selectionType, isSelecting, selection);
break;
case 'range':
handleSelectionChange(selectionType, isSelecting, selection, position);
break;
default:
console.warn(`Unhandled selection type: ${selectionType}`);
}
}}
The documentation does explain at all how to do this, the available props also miss countless options that are available in the source. So to close this off does anybody have any ideas how to allow the uncheck all to work.
And finally, I beg can we please get documentation updated, including all available props and having some clear examples with clear code (also not using legacy components would be great too)