vanillaSelectBox
vanillaSelectBox copied to clipboard
set focus in search input selectBox
should have an option that gives focus on the search input
i add line 558 setTimeout(() => { self.inputBox.focus(); }, 500);
if (self.userOptions.stayOpen) {
self.drop.style.visibility = "visible";
self.drop.classList.add('show');
self.drop.style.boxShadow = "none";
self.drop.style.minHeight = (this.userOptions.maxHeight + 10) + "px";
self.drop.style.position = "relative";
self.drop.style.left = "0px";
self.drop.style.top = "0px";
self.button.style.border = "none";
} else {
this.main.addEventListener("click", function (e) {
if (self.isDisabled) return;
self.drop.style.left = self.left + "px";
self.drop.style.top = self.top + "px";
self.drop.style.visibility = "visible";
self.drop.classList.add('show');
self.drop.closest('.vsb-main').classList.add('dropdown-show');
setTimeout(() => {
self.inputBox.focus();
}, 500);
document.addEventListener("click", docListener);
e.preventDefault();
e.stopPropagation();
if (!self.userOptions.stayOpen) {
VSBoxCounter.closeAllButMe(self.instanceOffset);
}
});
}