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

Function end

packages/react-aria/src/selection/useSelectableCollection.ts:314–333  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

312 };
313
314 let end = (e: KeyboardEvent) => {
315 if (delegate.getLastKey) {
316 if (manager.focusedKey === null && e.shiftKey) {
317 return false;
318 }
319 let lastKey = delegate.getLastKey(manager.focusedKey, isCtrlKeyPressed(e));
320 manager.setFocusedKey(lastKey);
321 if (lastKey != null) {
322 if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {
323 manager.extendSelection(lastKey);
324 return;
325 } else if (selectOnFocus) {
326 manager.replaceSelection(lastKey);
327 return;
328 }
329 }
330 return;
331 }
332 return false;
333 };
334
335 let pageDown = (e: KeyboardEvent) => {
336 if (delegate.getKeyPageBelow && manager.focusedKey != null) {

Calls 5

isCtrlKeyPressedFunction · 0.90
getLastKeyMethod · 0.65
setFocusedKeyMethod · 0.65
extendSelectionMethod · 0.65
replaceSelectionMethod · 0.65

Tested by

no test coverage detected