Skip to content

feat: cascade ion-segment mode to ion-segment-button children #18285

@peterpeterparker

Description

@peterpeterparker

Feature Request

Ionic version:
[x] 4.x

Describe the Feature Request
I think it would be cool to cascade the mode attribute from an ion-segment to its ion-segment-button children

Right now, if I want to use only the md style, on iOS I have to explicitly specify the mode not only on the parent segment but also on all children

For example:

<ion-segment [(ngModel)]="category" mode="md"> <!-- Render style class MD on iOS -->
  <ion-segment-button value="segment_1" checked> <!-- Render style class  iOS on iOS -->
     Segment 1
   </ion-segment-button>
   <ion-segment-button value="segment_2"> <!-- Render style class iOS on iOS -->
     Segment 2
   </ion-segment-button>
</ion-segment>

To apply md everywhere I have currently to do the following:

<ion-segment [(ngModel)]="category" mode="md"> <!-- Render style class MD on iOS -->
  <ion-segment-button ... mode="md"> <!-- Render style class  md on iOS -->
     Segment 1
   </ion-segment-button>
   <ion-segment-button ...  mode="md"> <!-- Render style class md on iOS -->
     Segment 2
   </ion-segment-button>
</ion-segment>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions