MCPcopy
hub / github.com/TarekRaafat/autoComplete.js / select

Function select

src/controllers/listController.js:190–207  ·  view source on GitHub ↗
(ctx, event, index)

Source from the content-addressed store, hash-verified

188 * @param {Number} index - of the selected result item
189 */
190const select = (ctx, event, index) => {
191 // Check if cursor within list range
192 index = index >= 0 ? index : ctx.cursor;
193
194 // Prevent empty selection
195 if (index < 0) return;
196
197 // Prepare Selection data feedback object
198 ctx.feedback.event = event;
199 feedback(ctx, index);
200
201 /**
202 * @emit {selection} event on result item selection
203 **/
204 eventEmitter("selection", ctx);
205
206 close(ctx);
207};
208
209/**
210 * Click selection handler

Callers 3

extend.jsFile · 0.90
clickFunction · 0.70
navigateFunction · 0.70

Calls 2

feedbackFunction · 0.70
closeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…