Issues with ion-slides functionality in Ionic 3 not functioning properly on web browsers

When using ion-slides in Ionic 3, everything functions correctly on Android and iOS apps; I am able to swipe each row individually while the others remain stationary.

However, when attempting to "swipe" using the mouse on a browser, the expected behavior does not occur. If I swipe the first row, it causes the slides in the second and third rows to also change position.

Below is my template:

<ion-card *ngFor="let channel of channels; let i = index;">
        <ion-card-header {{channel.title}}</ion-card-header>
        <ion-card-content>
            <ion-slides slidesPerView=4 spaceBetween="5">
                <ion-slide *ngFor="let video of channels[i].playlist">
                    <img src="https://.../thumbs/{{video.mediaid}}"/>
                </ion-slide>
            </ion-slides>
     </ion-card-content>
 </ion-card>

What could be causing this issue?

I have also attempted to use the next and prev buttons, but I am struggling to find a way to configure the swiper options (as Slides input options were removed in Ionic 3.0.0).

How should I go about initializing the slider?

According to Swiper documentation, I need to set:

{ ...,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
...
}

Answer №1

If you're looking for information on how to navigate through slides in Ionic, make sure to take a look at the official Slide documentation as it covers everything you need.

One way to implement a button that allows users to go to the next slide is by using the following code snippet:

<button ion-button (click)="goToNextSlide()">Next</button>
import { QueryList, ViewChildren } from '@angular/core';
import { Slides } from 'ionic-angular';

class MyPage {
  @ViewChildren(Slides) slides: QueryList<Slides>;

  goToNextSlide() {
    this.slides.forEach((slide) => { slide.next(); });
  }
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular and Ngrx: The optimal approach for choosing a value within a component and a function

While browsing through this Stack Overflow thread, I stumbled upon a question similar to mine. However, I'm curious if the solution provided in the comments is still considered the best practice in today's standards. Here's where I stand: ...

The issue of TypeScript conditional property failure when using Omit functionality

After defining a baseProps type, I discovered that I can successfully execute prop.onHotSave() if prop.hotSave is true when using this type directly. However, the scenario changes when I create a new prop using Omit; the previous functionality no longer f ...

What is the best way to troubleshoot the type of data being sent to the subscriber of an Angular observable?

I am new to the world of Angular-7, RxJS-6, and Visual Studio Code. Currently, I am facing a challenge with debugging an Observable that is being returned to a subscriber, resulting in a "TypeError" at runtime. It seems like this issue is not uncommon amon ...

Visual Studio is refusing to highlight my code properly, intellisense is failing to provide suggestions, and essential functions like go to definition are not functioning as expected

Due to a non-disclosure agreement, I am unable to share any code. However, I am experiencing an issue with Visual Studio not highlighting my code or allowing me to utilize its built-in tools. While I can rebuild the project, I cannot edit or access any fil ...

Implementing strict typing in Twitter widget to eliminate issues with accessing members

I'm struggling to properly type my Twitter widget in TypeScript. Currently, I am encountering several errors such as: ESLint: Unsafe call of an any typed value.(@typescript-eslint/no-unsafe-call) ESLint: Unsafe member access .catch on an any value.(@ ...

Attempting to develop a server component that will transmit a JSON result set from a MySQL database located on the local server. What is the best method to send the server object (RowDataPacket) to the

After successfully rendering server-side pages and creating forms with react hooks for database updates, I encountered a challenge in integrating Ag-Grid into my application. Despite being able to retrieve data from the database using the mysql2 module and ...

The Angular component fails to load in the browser because of a problem with the Observable subscription

Whenever I try to execute the getCurrentSalahOrIqamah function in the ngOninit lifecycle hook of this component, my browser gets stuck and the component doesn't load properly. I've attempted using both lazyloaded and eager loaded components, but ...

How can we transform an object into an array using Typescript generics?

Can someone help me with this function? export const ObjectToArray = <T>(object: T): { key: unknown; value: unknown }[] => Object.entries(object).map(o => ({ key: o[0], value: o[1] })); I'm trying to remove the any part from the result ...

Angular Material Themes - retrieve the current main color shade

My current setup includes two themes: Theme 1: Light $candy-app-primary: mat-palette($mat-blue, A700); $candy-app-accent: mat-palette($mat-orange, A200, A100, A400); $candy-app-warn: mat-palette($mat-red); $candy-app-theme: mat-light-theme($candy-app ...

What is the best way to stop webpack from generating typescript errors for modules that are not being used?

The directory structure is set up as follows: └── src ├── tsconfig.json ├── core │ ├── [...].ts └── ui ├── [...].tsx └── tsconfig.json Within the frontend, I am importing a limi ...

Error Message: Attempting to access the AngularJS injector before it has been initialized

Using AngularJS Service in an Angular 5 Component I have an existing AngularJS application and I am attempting to create a hybrid app. However, I am encountering difficulties using an AngularJS service within an Angular component, resulting in the followi ...

The Angular BehaviorSubject observable is returning a null value

I am experiencing an issue where I pass data through components using behavior subject. However, when I try to retrieve it with subscribe, it shows null even though the service returns a real value. To reproduce the issue, you can check out the code here: ...

Utilizing Ionic 3 on iOS 11, ensure that GPS location is always requested

I'm encountering an issue with the latest iOS version on my iPhone where the 'always' option to track my location is not available. I can only choose between while using the app and never. This feature was working fine on previous iOS versio ...

Navigating with the Angular router leads to an unexpected destination: "mat-radio-group-0=true"

I'm facing an issue with a close button in my HTML template that triggers a close() function in the component: HTML template: <div> <label id="radio-group-label">Please specify: </label> <mat-radio-grou ...

Issue accessing page from side menu in Ionic 2 application

I am experiencing an issue where the page does not open when I click on it in the side menu. Here is my app.component.ts file: this.pages = [ { title: 'NFC Page', component: NfcPage, note: 'NFC Page' }, ...

Tips for resolving the error message "TypeError: Converting circular structure to JSON"

I had a straightforward query where I needed to select all from the aliases table. Everything was working fine until I ran npm update. TypeError: Converting circular structure to JSON public async fetchAliases(req: Request, res: Response): Promise< ...

Allow Visual Studio Code to create a constructor for Typescript class

When developing Angular 2 apps in Typescript using Visual Studio Code, one common task is writing constructors with their parameter list. Is there a way to save time and effort on this? It would be really helpful if the IDE could automatically generate th ...

"Exploring Angular with Storybook: Enhancing Components with NgControl

Having created the following Class : export class TestComponent implements OnInit, ControlValueAccessor { constructor( @Optional() @Self() public ngControl: NgControl) { if (ngControl) { ngControl.valueAccessor = this; } } I am now in ...

Exploring the power of TypeScript for authenticating sessions with NextJS

Utilizing next-auth's getSession function in API routes looks something like this for me: const mySession = await getSession({ req }); I have confirmed that the type of the mySession is outlined as follows: type SessionType = { user: { email: s ...

Challenges with npm installation in Angular Quickstart

I've been following the Angular getting started guide and encountered some issues. After cloning the repository, I attempted to run npm install, but I'm encountering errors: npm WARN package.json <a href="/cdn-cgi/l/email-protection" class=" ...