vanillaSelectBox icon indicating copy to clipboard operation
vanillaSelectBox copied to clipboard

set focus in search input selectBox

Open stgcorpbr opened this issue 2 years ago • 1 comments

should have an option that gives focus on the search input

stgcorpbr avatar Jun 02 '22 14:06 stgcorpbr

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);
                }
            });
        }

stgcorpbr avatar Jun 06 '22 20:06 stgcorpbr