title: PrimeNG stop to open accordion
body: <p>How I can to force not open an accordion in PrimeNG. I mean in some circumstances I don't wanna that the accordion I selected opens. I tried in this way but it doesn't work</p>
  
  <p><a href="https://www.primefaces.org/primeng/showcase/#/accordion" rel="nofollow noreferrer">https://www.primefaces.org/primeng/showcase/#/accordion</a></p>
  
  <pre><code>  &lt;p-accordion #accordionQuestion *ngIf="questionItems &amp;&amp; questionItems.length &gt; 0"
                       [activeIndex]="currentIndexAccordion"
                       class="text-left mt-2 w-100"
                       (onOpen)="checkOpenAccordion($event)"
                       [expandIcon]="'fa fa-fw fa-chevron-right'"
                       [collapseIcon]="'fa fa-fw fa-chevron-down'"&gt;
  
            &lt;p-accordionTab #accordionTab *ngFor="let question of questionItems; let i = index;" 
                     class="mb-2" id="accordionTab"&gt;
              &lt;p-header class="w-100"&gt;
                &lt;span class="w-100" [innerText]="question.code + ' - ' + question.text"&gt;&lt;/span&gt;
              &lt;/p-header&gt;
               &lt;question #question *ngIf="i == currentIndexAccordion"
               (formValuesChanged)="questionChanged($event)"
                &lt;/question&gt;
            &lt;/p-accordionTab&gt; 
  
     &lt;/p-accordion&gt;
  </code></pre>
  
  <p>where the method <strong>checkOpenAccordion</strong> is</p>
  
  <pre><code>@ViewChild('question', {static: false}) accordion: Accordion;
  
  checkOpenAccordion(index: number) {
             if (this.currentIndexAccordion != index &amp;&amp; this.changed) {
                  this.disabledOthersAccordion();
                  this.accordionQuestion.activeIndex = this.currentIndexAccordion;
             } else {
                 this.currentIndexAccordion = index;
             }
  }
  
  
  
  
    disabledOthersAccordion() {
        if (this.accordion &amp;&amp; this.accordion.tabs &amp;&amp; 
           this.accordionDomande.tabs.length &gt; 0) {
            for (let i = 0; i &lt; this.accordion.tabs.length; i++) {
              if (i !== this.currentIndexAccordion) {
                this.accordion.tabs[i].disabled = true;
              }
            }
          }
      }
  
  
  questionChanged(changed) {
    this.changed = changed;
  }
  </code></pre>