elation.require(['elements.ui.button'], function() {
  elation.elements.define('ui.togglebutton', class extends elation.elements.ui.button {
    init() {
      super.init();
      this.defineAttributes({
        active: { type: 'boolean', default: false }
      });
    }    
    create() {
      super.create();
    }
    handleClick(ev) {
      if (ev.button == 0) {
        if (!this.active) {
          this.activate();
        } else {
          this.deactivate();
        }
      }
    }
    activate() {
      let events = this.dispatchEvent({type: 'activate'});
      let processdefault = true;
      events.forEach(e => { processdefault &= e.returnValue });
      if (processdefault) {
        this.active = true;
      }
    }
    deactivate() {
      let events = this.dispatchEvent({type: 'deactivate'});
      let processdefault = true;
      events.forEach(e => { processdefault &= e.returnValue });
      if (processdefault) {
        this.active = false;
      }
    }
    toggle() {
      if (this.active) {
        this.deactivate();
      } else {
        this.activate();
      }
    }
  });
});

@@ -573,123 +573,66 @@
     
-let processdefault = true;%0A      events.forEach(e =%3E %7B processdefault &= e.returnValue %7D);%0A      if (processdefault
+if (!events %7C%7C !elation.events.wasDefaultPrevented(events)
 ) %7B%0A
@@ -763,123 +763,66 @@
     
-let processdefault = true;%0A      events.forEach(e =%3E %7B processdefault &= e.returnValue %7D);%0A      if (processdefault
+if (!events %7C%7C !elation.events.wasDefaultPrevented(events)
 ) %7B%0A

Use elation.events.wasDefaultPrevented()