MCPcopy
hub / github.com/Choices-js/Choices / hideDropdown

Method hideDropdown

src/scripts/choices.ts:538–558  ·  view source on GitHub ↗
(preventInputBlur?: boolean)

Source from the content-addressed store, hash-verified

536 }
537
538 hideDropdown(preventInputBlur?: boolean): this {
539 if (!this.dropdown.isActive) {
540 return this;
541 }
542
543 this._removeHighlightedChoices();
544
545 requestAnimationFrame(() => {
546 this.dropdown.hide();
547 this.containerOuter.close();
548
549 if (!preventInputBlur && this._canSearch) {
550 this.input.removeActiveDescendant();
551 this.input.blur();
552 }
553
554 this.passedElement.triggerEvent(EventType.hideDropdown);
555 });
556
557 return this;
558 }
559
560 getValue<B extends boolean = false>(valueOnly?: B): EventChoiceValueType<B> | EventChoiceValueType<B>[] {
561 const values = this._store.items.map((item) => {

Callers 15

_handleChoiceActionMethod · 0.95
_onInputMethod · 0.95
_onEnterKeyMethod · 0.95
_onEscapeKeyMethod · 0.95
_onClickMethod · 0.95
_onBlurMethod · 0.95
_onFormResetMethod · 0.95
choices.jsFile · 0.80
choices.mjsFile · 0.80

Calls 6

hideMethod · 0.80
closeMethod · 0.80
blurMethod · 0.80
triggerEventMethod · 0.80

Tested by

no test coverage detected