MCPcopy Create free account
hub / github.com/adobe/react-spectrum / removeSelectedItems

Function removeSelectedItems

packages/react-stately/src/data/useListData.ts:306–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304 });
305 },
306 removeSelectedItems() {
307 dispatch(state => {
308 if (state.selectedKeys === 'all') {
309 return {
310 ...state,
311 items: [],
312 selectedKeys: new Set()
313 };
314 }
315
316 let selectedKeys = state.selectedKeys;
317 let items = state.items.filter(item => !selectedKeys.has(getKey!(item)));
318 return {
319 ...state,
320 items,
321 selectedKeys: new Set()
322 };
323 });
324 },
325 move(key: Key, toIndex: number) {
326 dispatch(state => {
327 let index = state.items.findIndex(item => getKey!(item) === key);

Callers

nothing calls this directly

Calls 2

filterMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected