akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

Accordion trigger two time #3201

Open ThaiDuy12345 opened 1 year ago

ThaiDuy12345 commented 1 year ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

Current behavior: Trigger (collapsedChange) event emitter by open/close the nb-accordion-item if i opened the accordion, its logged true and false, otherwise, it logged true and true

Expected behavior: only logging true when open only logging false when close

Steps to reproduce: open and close the accordion Related code:

<nb-accordion class="shadow-none" *ngFor="let item of order">
  <nb-accordion-item class="mb-5" (collapsedChange)="something($event)">
    <nb-accordion-item-header>
    </nb-accordion-item-header>
    <nb-accordion-item-body> Item Content </nb-accordion-item-body>
  </nb-accordion-item> 
</nb-accordion>
something(isOpen: boolean): void {
    console.log(isOpen)
 }

log:

true
false
true
true
true
false
true
true

Other information:

npm, node, OS, Browser

Node, npm: v18.17.0 and 9.8.1
OS: Windows (7/8/10)
Browser: MSEdge

Angular, Nebular

"@angular/core": "^16.1.0",
"@nebular/eva-icons": "^11.0.0",
"@nebular/theme": "^11.0.0",
Jzeemo commented 10 months ago

Having the same issue.