Skip to content

Commit

Permalink
fix: make isSeparatorVisible full signal #17482 (#17483)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaSchTour authored Jan 29, 2025
1 parent 3461d28 commit 506d819
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/primeng/src/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export interface StepPanelContentTemplateContext {
'[class.p-component]': 'true'
}
})
export class StepList extends BaseComponent {}
export class StepList extends BaseComponent {
steps = contentChildren(Step);
}

@Component({
selector: 'p-stepper-separator',
Expand Down Expand Up @@ -198,9 +200,12 @@ export class Step extends BaseComponent implements AfterContentInit {

isSeparatorVisible = computed(() => {
if (this.pcStepper.stepList()) {
const index = findIndexInList(this.el.nativeElement, this.pcStepper.stepList().el.nativeElement.children);
const stepLen = find(this.pcStepper.stepList().el.nativeElement, '[data-pc-name="step"]').length;
const steps = this.pcStepper.stepList().steps();
const index = steps.indexOf(this);
const stepLen = steps.length;
return index !== stepLen - 1;
} else {
return false;
}
});
/**
Expand Down

0 comments on commit 506d819

Please sign in to comment.