From 000f55303e459c583e642337fb1894f419f37d48 Mon Sep 17 00:00:00 2001 From: Tanner Reits <47483144+tanner-reits@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:16:15 -0500 Subject: [PATCH] fix(segment): add logic to connect to segment-view in `componentDidLoad()` callback (#30060) Issue number: resolves #30000 --------- ## What is the current behavior? The "swipeable segments" feature does not work correctly in an Angular environment (tested with both standalone and module architecture). The issues is that the `ion-segment-view` element is not correctly "attached" to the segment since it does not exist at the time the `connectedCallback()` is first executed. ## What is the new behavior? Added the logic to connect the `ion-segment-view` to the `componentDidLoad()` callback in addition to the `connectedCallback()`. The existing logic was left in place for the case where the element is removed and reattached to the DOM. ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Dev Build: `8.4.2-dev.11733239325.140ef7c3` --- core/src/components/segment/segment.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/components/segment/segment.tsx b/core/src/components/segment/segment.tsx index 074c2586b8..6a56f8fddd 100644 --- a/core/src/components/segment/segment.tsx +++ b/core/src/components/segment/segment.tsx @@ -188,6 +188,8 @@ export class Segment implements ComponentInterface { } async componentDidLoad() { + this.segmentViewEl = this.getSegmentView(); + this.setCheckedClasses(); /**