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

bug: Swipeable Segments #30000

Open
3 tasks done
Hesesses opened this issue Nov 5, 2024 · 3 comments
Open
3 tasks done

bug: Swipeable Segments #30000

Hesesses opened this issue Nov 5, 2024 · 3 comments
Labels
type: bug a confirmed bug report

Comments

@Hesesses
Copy link

Hesesses commented Nov 5, 2024

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Swipeble segments' segment buttons not working with variables:

<ion-segment mode="md" [value]="value">
  @for (button of buttons; track button.label) {
    <ion-segment-button [value]="button.value" [contentId]="button.value">
      <ion-label>{{ button.label }}</ion-label>
    </ion-segment-button>
  }
</ion-segment>

If I add manually segment-button with the content-id of the first segment view (general) it works:

<ion-segment mode="md" [value]="value" (ionChange)="onChange.emit($event)" [scrollable]="true">
  <ion-segment-button [value]="" content-id="general" style="margin-right:0px"></ion-segment-button>
  @for (button of buttons; track button.label) {
  ....

If I add the same like this [contentId]= it doesnt work:

<ion-segment mode="md" [value]="value" (ionChange)="onChange.emit($event)" [scrollable]="true">
<ion-segment-button [value]="" [contentId]="'general'" style="margin-right:0px"></ion-segment-button>
@for (button of buttons; track button.label) {

Note: ion-segment-views are swipeable, swiping doesnt change active status of segment buttons or clicking segment-buttons doesnt change the view.

Expected Behavior

Swipeable tabs would work when using variables for content-id / [contentId]

Steps to Reproduce

Play around with the code on "current behaviour"

Code Reproduction URL

no url

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (/Users/.../.nvm/versions/node/v18.20.4/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.4.0
@angular-devkit/build-angular : 17.3.11
@angular-devkit/schematics : 17.3.11
@angular/cli : 17.3.11
@ionic/angular-toolkit : 11.0.1

Capacitor:

Capacitor CLI : 6.1.2
@capacitor/android : 6.1.2
@capacitor/core : 6.1.2
@capacitor/ios : 6.1.2

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v18.20.4 (/Users/.../.nvm/versions/node/v18.20.4/bin/node)
npm : 10.7.0
OS : macOS Unknown

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 5, 2024
@marcoagsa
Copy link

I’m experiencing the same issue reported and have created an example on StackBlitz to help demonstrate it:
stackblitz Example
Could you please take a look and let me know if there’s any solution or workaround available?

Thank you for your assistance!

Captura de ecrã 2024-11-12, às 22 48 52

@Hesesses
Copy link
Author

Any updates on this?

@tanner-reits
Copy link
Member

@Hesesses Sorry for the delay. Confirmed there's something wrong here and I'll take a look. Thanks!

@tanner-reits tanner-reits added type: bug a confirmed bug report and removed triage labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

3 participants