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

Function addKeysToSelection

packages/react-stately/src/data/useListData.ts:200–217  ·  view source on GitHub ↗
(selectedKeys: Selection)

Source from the content-addressed store, hash-verified

198 }));
199 },
200 addKeysToSelection(selectedKeys: Selection) {
201 dispatch(state => {
202 if (state.selectedKeys === 'all') {
203 return state;
204 }
205 if (selectedKeys === 'all') {
206 return {
207 ...state,
208 selectedKeys: 'all'
209 };
210 }
211
212 return {
213 ...state,
214 selectedKeys: new Set([...state.selectedKeys, ...selectedKeys])
215 };
216 });
217 },
218 removeKeysFromSelection(selectedKeys: Selection) {
219 dispatch(state => {
220 if (selectedKeys === 'all') {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected