export const activeableMixin = (superclass) =>
  class ActiveableMixinClass extends superclass {
    init() {
      super.init?.();

      this.baseElement.addEventListener('mousedown', (e) => {
        e.preventDefault();
        this.setAttribute('active', 'true');
        window.addEventListener('mouseup', () => this.removeAttribute('active'), {
          once: true,
        });
      });
    }
  };
