resolveVisibleStepSlot
resolveVisibleStepSlot(
steps,data,slot):number
Resolves which step slot (an index into the full, unfiltered steps array — stable across a
visibility change, unlike an index into resolveSteps’ own filtered output) is actually shown
when the respondent’s own tracked position is slot.
A step’s condition can only reference an earlier step, so editing an answer via Back can change
the visibility of any step strictly between the one just edited and the respondent’s current
position — not only steps still ahead. If slot itself just became hidden by such an edit, this
falls back to the nearest earlier still-visible slot (searched first, since that’s the direction an
edit-then-advance always comes from), or the nearest later one only if nothing earlier is visible
either (reachable only if every slot up to and including slot was hidden at once). slot itself
is returned unchanged whenever it’s still visible — a no-op for a form with no conditional steps.
Parameters
Section titled “Parameters”FormStep[]
number
Returns
Section titled “Returns”number