Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make isSeparatorVisible full signal #17482 #17483

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: make isSeparatorVisible full signal #17482
  • Loading branch information
DaSchTour committed Jan 24, 2025
commit 0c09c32ef0375bc68f1049c6a019cd04dd50bab5
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