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

Function close

src/controllers/listController.js:93–108  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

91 * @param {Object} ctx - autoComplete.js context
92 */
93const close = (ctx) => {
94 if (!ctx.isOpen) return;
95 // Set expanded attribute on the parent to false
96 (ctx.wrapper || ctx.input).setAttribute(Expand, false);
97 // Add input active descendant attribute
98 ctx.input.setAttribute(Active, "");
99 // Add hidden attribute from list
100 ctx.list.setAttribute("hidden", "");
101 // Set list to closed
102 ctx.isOpen = false;
103
104 /**
105 * @emit {close} event after "resultsList" is closed
106 **/
107 eventEmitter("close", ctx);
108};
109
110/**
111 * Go to result item by index

Callers 6

blurFunction · 0.90
extend.jsFile · 0.90
start.jsFile · 0.90
renderFunction · 0.70
selectFunction · 0.70
navigateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…