diff --git a/core/src/components/segment-view/segment-view.tsx b/core/src/components/segment-view/segment-view.tsx index 3646013ca4..b63b2348d4 100644 --- a/core/src/components/segment-view/segment-view.tsx +++ b/core/src/components/segment-view/segment-view.tsx @@ -17,7 +17,7 @@ export class SegmentView implements ComponentInterface { if (!atSnappingPoint) return; const index = Math.round(scrollLeft / offsetWidth); - const segmentContent = this.getSegmentContentAtIndex(index); + const segmentContent = this.getSegmentContents()[index]; if (segmentContent === null || segmentContent === undefined) { return; @@ -50,10 +50,6 @@ export class SegmentView implements ComponentInterface { return Array.from(this.el.querySelectorAll('ion-segment-content')); } - private getSegmentContentAtIndex(index: number) { - return this.getSegmentContents()[index]; - } - private getSegmentButtonById(id: string) { return document.querySelector(`ion-segment-button[content-id="${id}"]`); }