File tree Expand file tree Collapse file tree 5 files changed +11
-5
lines changed
standalone/src/directives Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2730,7 +2730,6 @@ export namespace Components {
27302730 */
27312731 "disabled" : boolean ;
27322732 /**
2733- * This method is used to programmatically set the displayed segment content in the segment view. Calling this method will update the `value` of the corresponding segment button.
27342733 * @param id : The id of the segment content to display.
27352734 * @param smoothScroll : Whether to animate the scroll transition.
27362735 */
Original file line number Diff line number Diff line change @@ -106,9 +106,12 @@ export class SegmentView implements ComponentInterface {
106106 }
107107
108108 /**
109+ * @internal
110+ *
109111 * This method is used to programmatically set the displayed segment content
110112 * in the segment view. Calling this method will update the `value` of the
111113 * corresponding segment button.
114+ *
112115 * @param id: The id of the segment content to display.
113116 * @param smoothScroll: Whether to animate the scroll transition.
114117 */
Original file line number Diff line number Diff line change @@ -106,6 +106,12 @@ export class Segment implements ComponentInterface {
106106 // The scroll listener should handle scrolling the active button into view as needed
107107 if ( ! this . segmentViewEl ) {
108108 this . scrollActiveButtonIntoView ( ) ;
109+ } else {
110+ const activeButton = this . getButtons ( ) . find ( ( button ) => button . value === value ) ;
111+
112+ if ( activeButton ?. contentId ) {
113+ this . segmentViewEl . setContent ( activeButton . contentId ) ;
114+ }
109115 }
110116 }
111117
Original file line number Diff line number Diff line change @@ -2027,8 +2027,7 @@ export declare interface IonSegmentContent extends Components.IonSegmentContent
20272027
20282028
20292029@ProxyCmp ( {
2030- inputs : [ 'disabled' ] ,
2031- methods : [ 'setContent' ]
2030+ inputs : [ 'disabled' ]
20322031} )
20332032@Component ( {
20342033 selector : 'ion-segment-view' ,
Original file line number Diff line number Diff line change @@ -1865,8 +1865,7 @@ export declare interface IonSegmentContent extends Components.IonSegmentContent
18651865
18661866@ProxyCmp ( {
18671867 defineCustomElementFn : defineIonSegmentView ,
1868- inputs : [ 'disabled' ] ,
1869- methods : [ 'setContent' ]
1868+ inputs : [ 'disabled' ]
18701869} )
18711870@Component ( {
18721871 selector : 'ion-segment-view' ,
You can’t perform that action at this time.
0 commit comments