MCPcopy
hub / github.com/nilbuild/driver.js / handleArrowLeft

Function handleArrowLeft

src/driver.ts:153–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 }
152
153 function handleArrowLeft() {
154 const isTransitioning = getState("__transitionCallback");
155 if (isTransitioning) {
156 return;
157 }
158
159 const activeIndex = getState("activeIndex");
160 const activeStep = getState("__activeStep");
161 const activeElement = getState("__activeElement");
162 if (typeof activeIndex === "undefined" || typeof activeStep === "undefined") {
163 return;
164 }
165
166 const steps = getConfig("steps") || [];
167 if (!steps[activeIndex - 1]) {
168 return;
169 }
170
171 const onPrevClick = activeStep.popover?.onPrevClick || getConfig("onPrevClick");
172 if (onPrevClick) {
173 return onPrevClick(activeElement, activeStep, {
174 config: getConfig(),
175 state: getState(),
176 driver: getCurrentDriver(),
177 });
178 }
179
180 movePrevious();
181 }
182
183 function handleArrowRight() {
184 const isTransitioning = getState("__transitionCallback");

Callers

nothing calls this directly

Calls 4

getStateFunction · 0.90
getConfigFunction · 0.90
getCurrentDriverFunction · 0.90
movePreviousFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…