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

Function findEnabledStep

packages/react-aria-components/src/Wizard.tsx:357–366  ·  view source on GitHub ↗
(
  key: Key | null,
  disabledKeys: Set<Key>,
  getNextKey: (key: Key) => Key | null
)

Source from the content-addressed store, hash-verified

355// The closest step to the given one, including itself, in the direction of getNextKey that isn't in
356// disabledKeys.
357function findEnabledStep(
358 key: Key | null,
359 disabledKeys: Set<Key>,
360 getNextKey: (key: Key) => Key | null
361): Key | null {
362 while (key != null && disabledKeys.has(key)) {
363 key = getNextKey(key);
364 }
365 return key;
366}
367
368// The position of a step within the wizard, or -1 if the key isn't one of its steps.
369function getStepIndex<T>(collection: ICollection<Node<T>>, key: Key | null): number {

Callers 1

useWizardStateFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected