const resizeElement = (el) => {
  el.style.height = `auto`;
  el.style.height = `${el.clientHeight - el.offsetHeight + el.scrollHeight}px`;
};

export default {
  update: resizeElement,
  inserted: resizeElement,
  bind(el) {
    el.classList.add('skillbox-auto-grow');
    el.addEventListener('input', () => {
      resizeElement(el);
    });
  },
  unbind(el) {
    el.classList.remove('skillbox-auto-grow');
    el.removeEventListener('input', () => {
      resizeElement(el);
    });
  },
};
