When transitioning from a popover to a page in Ionic 2, the ability to scroll is no longer available

When navigating to a page from a popover in Ionic2, scrolling is disabled. Here are the details of the issue:

I have 3 pages, with one being the timeline containing the following code:

 let popover = Popover.create(ItemListPage, {items: data.data});
this.nav.present(popover);

In the above code, the timeline calls a popover called ItemList, which has the following code:

 close() {
   this.viewCtrl.dismiss();
 }

 showUserProfile(user){
   this.close(); //I added this line to check if the popover is causing the issue
   this.nav.push(UserProfilePage, { userToShow: user});
 }

As seen in the code, when an item in the popover is clicked, the showUserProfile function is triggered. It closes the popover (added for debugging purposes) and then navigates to another page: UserProfilePage.

In the UserProfilePage, there is a scroller that works fine in all cases except when navigating from the ItemListPage popover. In this scenario, the scroller only works if I replace

this.nav.push(UserProfilePage, { userToShow: user});

with

    this.nav.setRoot(UserProfilePage, { userToShow: user});

I'm unsure why this issue occurs and how to rectify it. PS: I intend to keep the popover open, but I included the closure for troubleshooting purposes.

Answer №1

It is important to note that this.viewCtrl.dismiss() returns a promise, therefore it should be used correctly in the following manner:

close() {
   return this.viewCtrl.dismiss();
 }
 displayUserDetails(user){
   this.close().then(response =>{
       this.nav.push(UserProfilePage, { userToShow: user});
   });
 }

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

Creating a JSON array or JSON object from an Angular Material table

My task is to create a JSON array or object from an Angular Material table, which I can then utilize to export to an Excel sheet. Here is the data: const ELEMENT_DATA: Element[] = [ {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: &apo ...

Guide on changing i18n dynamically using bootstrap selectpicker

I recently encountered an issue while trying to implement the i18n function of selectpicker in Angular 7. The documentation I referred to at suggested that adding data-lang="zh_CN" should change the language, but unfortunately, it didn't work as expe ...

Error message: "Webpack cannot find TypeORM module during build process"

After researching the issue extensively, I came across various discussions on the typeorm github repository. Unfortunately, all of them were closed without a definite solution provided. It appears to be related to a webpack problem, but the exact nature of ...

Comparing AngularJS controller and template encapsulation to Angular components: a breakdown

I've set up a state in my angularjs app called homeInside, complete with its own controller and template. Within that layout, I have various elements including a button with an ng-click event tied to the function doSomething. Additionally, there is an ...

Enhancing Angular ngbDatepicker functionality by incorporating context into the markDisabled feature

In my code, I have defined an input field with ngbDatepicker. To disable certain days, I am using [markDisabled]="getDisabledDays" as shown below: <input type="text" [minDate]="getMinDate()" [maxDate]="maxDate" formControlName="deliverydate" #d= ...

Using [(ngModel)] on a field within an object that is nested inside another object

I am facing a challenge as I attempt something that may or may not be feasible. Within an Angular form, I have an object structured like this: export class NewUserRegisterModelDTO{ userData:UserDetailModelDTO; roles:RoleModelDTO[]; ownerData:O ...

Transmit information through a router connection

When attempting to pass data from one page to another routing page using [queryParams]="{'usd':usd, 'count' :country, 'name' :name}" through the routing button, it works perfectly fine but an error is displayed in my console. ...

Why does the data appear differently in Angular 9 compared to before?

In this particular scenario, the initial expression {{ bar }} remains static, whereas the subsequent expression {{ "" + bar }} undergoes updates: For example: two 1588950994873 The question arises: why does this differentiation exist? import { Com ...

typescript: understanding how to deduce an array in a union rather than multiple arrays

Consider a scenario where we have a function called toArray which takes an argument and returns it as an array if it is already an array, or returns an array containing the argument value: // Here is the implementation of the toArray function: export const ...

Angular error: Unable to locate a distinguishing object '[object Object]' of type 'object'. NgFor is only compatible with binding to Iterables like Arrays

Greetings everyone! I am currently exploring the openWeb API to retrieve some data. While I was able to successfully display the data in the console, I'm facing difficulties when it comes to actually presenting it on the screen. ERROR Error: Cannot f ...

When attempting to play a YouTube video, Video.js throws an error stating that the identifier "youtube" is undefined

@Component({ selector: 'invidz-video-js-component', template: ` <div id="full-background"> <video id="vid" class="video-js vjs-default-skin vjs-fullscreen vjs-big-play-centered" controls data-setup='{ "techOrder" ...

Simple steps to turn off error highlighting for TypeScript code in Visual Studio Code

Hey there! I've encountered an issue with vscode where it highlights valid code in red when using the union operator '??' or optional chaining '?.'. The code still builds without errors, but vscode displays a hover error message st ...

Troubleshooting a NestJS application within an Nx workspace by configuring a VScode Launch setup

I am facing an issue in VSCode while trying to launch a NestJS application using Nx in debug mode. I have the VSCode nightly js debugger extension installed, but something seems to be going wrong. I attempted to add type "module" to the package.json file, ...

typescript api overlooking the async await functionality

My controller contains an asynchronous method that is supposed to set a results object. However, I'm facing an issue where instead of waiting for the 'await' to finish executing, the code jumps to the response object call prematurely, leavin ...

Encountering a mistake that can be assigned to a type parameter

Within the code block below, I am utilizing "rxjs": "~6.2.0" canActivate():Observable<boolean> { return this.auth.user$.pipe ( switchMap( user => { return this. ...

Implementing redux-state-sync middleware in Angular-Redux for seamless state synchronization

I have some pre-existing code in AppModule where I originally set up the store: export class AppModule { constructor(ngRedux: NgRedux<IApplicationState>) { // Configuring the store in the constructor ngRedux.configureStore(rootReducer, INITI ...

Using <md-error> in Angular Material 2: A Comprehensive Guide

I am attempting to showcase an error message when a required input is invalid in Angular Material 2. An example can be found in the Angular Material demo app : <form novalidate> <h4>Within a form</h4> <md-input-container> ...

Error: Trying to access 'MaterialModule' before it has been initialized results in an uncaught ReferenceError

I have been working on a form for a personal project and attempted to implement a phone number input using this example: . However, after trying to integrate it into my project, I encountered an error. Even after removing the phone number input code, the e ...

Encountering a module error when using SignalR with Webpack and TypeScript: 'Unable to locate module './NodeHttpClient''

I am currently working on integrating a SignalR client into an Angular application using Webpack and TypeScript. Here is the content of my package.json file: { "private": true, "version": "0.0.0", "scripts": { "test": "karma start ClientApp/tes ...

Locate and embed within a sophisticated JSON structure

I have an object structured as follows: interface Employee { id: number; name: string; parentid: number; level: string; children?: Employee[]; } const Data: Employee[] = [ { id:1, name: 'name1', parentid:0, level: 'L1', children: [ ...