/* eslint-disable import/prefer-default-export */
export function closeOtherSelects(e) {
  const lists = document.querySelectorAll('[data-id="select-list"]');
  const listClassName = new RegExp(/\bshow.+?\b/, 'g');
  for (let i = 0; i < lists.length; i += 1) {
    if (e !== lists[i] && lists[i].className.match(listClassName)) {
      lists[i].className = lists[i].className.replace(listClassName, '');
    }
  }
}
