vanillaSelectBox icon indicating copy to clipboard operation
vanillaSelectBox copied to clipboard

Clicking again on the opened dropdown without selecting any option doesn't closes it.

Open msankhala opened this issue 2 years ago • 3 comments

Click on any vanilla selectbox it will open the dropdown, click it again without choosing anything. Ideally it should close the dropdown but doesn't closes it. It only closes when user clicks outside.

msankhala avatar May 20 '22 02:05 msankhala

Exactly, I have the same issue right now

kamilmaliszewski avatar May 27 '22 09:05 kamilmaliszewski

@msankhala I've fixed it. You can create patch or include file in repo and modify it. In line https://github.com/PhilippeMarcMeyer/vanillaSelectBox/blob/4e8a2e0c664a112bd32c88d068c266806825929d/vanillaSelectBox.js#L583 and 584 change them to

if (self.drop.style.visibility === 'visible') {
    self.closeOrder();
} else {
    self.drop.style.visibility = 'visible';
    document.addEventListener('click', docListener);
}

kamilmaliszewski avatar May 27 '22 09:05 kamilmaliszewski

I have created a Drupal module to support this library in drupal https://www.drupal.org/project/vanilla_selectbox

msankhala avatar May 31 '22 15:05 msankhala