A keyboard is pressing on tabs and navigating through the app's contents in Ionic 3 on an Android device

I'm currently working on an IONIC 3 app and facing a challenge. When I tap on the ion search and the Keyboard pops up in ANDROID, it disrupts the layout by pushing all the content around.

Original screen:

https://i.sstatic.net/34iBz.jpg

Keyboard mode active:

https://i.sstatic.net/wqhh0.jpg

Things I've tried so far:

In app.module.ts: scrollAssist: false,

autoFocusAssist: false,

and also: this.keyboard.disableScroll(true);

as well as: this.keyboard.disableScroll(false);

The behavior is normal on IOS devices

This issue occurs only on screens with TABS. On other screens, the keyboard works fine without pushing any content.

IONIC INFO:

cli packages:

@ionic/cli-utils  : 1.10.1
ionic (Ionic CLI) : 3.10.1

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 1.3.7
Cordova Platforms  : android 6.2.1 browser 4.1.0 ios 4.3.1
Ionic Framework    : ionic-angular 3.5.3

System:

ios-sim : 5.1.0 
Node    : v6.11.0
npm     : 3.10.10 
OS      : macOS Sierra
Xcode   : Xcode 8.3.3 Build version 8E3004b

My HTML:

<ion-header>

  <ion-navbar color = "festow-primary">
    <button ion-button menuToggle>
      <icon-icon name = "menu"></ion-icon>
    </button>
    <ion-title> Festas em {{cidadeCodigo}} </ion-title>
    <ion-buttons end>
      <button (click) = "modalPesquisa()" ion-button icon-only>
        <icon-icon name = "ios-funnel"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>

</ion-header>


<ion-content class = "teste">
  <ion-refresher (ionRefresh) = "doRefresh($event)">
    <ion-refresher-content
      pullingIcon = "arrow-dropdown"
      pullingText = "Pull to refresh"
      refreshingSpinner = "circles"
      refreshingText = "Refreshing...">
    </ion-refresher-content>
  </ion-refresher>
  <ion-searchbar *ngIf = "festa"
  placeholder = "Search..."
  [(ngModel)] = "myInput"
  (ionInput) = "onInput($event)">
</ion-searchbar>

  <ion-card *ngFor = "let festa of festas" class = "cards card-full" style = "border-color: #ffffff!important;">

    <img class = "card-image" src = "http://festow.com/images/{{festa.thumb}}" height = "42%" style = "border-color: #ffffff!important;">
    <ion-fab center edge class = "fab-cards">
        <button ion-fab mini class = "fab-button" (click) = "itemTapped($event, festa)"><icon-icon name = "add"></ion-icon></button>
      </ion-fab>
    <ion-card-content class = "card-content-grid-padding">
      <ion-grid class = "grid-padding">
        <ion-row>
          <ion-col col-6 col-sm>
            <p class = "p-cards fonte">{{festa.nome}}</p>
            <p class = "p-cards fonte">{{festa.horario}} - {{festa.hora_fim}}</p>
          </ion-col>
          <ion-col col-4 col-sm offset-2>
            <p class = "p-cards fonte">{{festa.nome_casa}}</p>
            <p class = "p-cards"><rating [score] = "festa.estrelas" max = "5"></rating></p>
          </ion-col>
        </ion-row>
      </ion-grid>
    </ion-card-content>

  </ion-card>
</ion-content>

My TS:

ngOnInit() {
    // this.keyboard.disableScroll(true);
    // this.keyboard.disableScroll(false);
      this.presentLoading();

      setTimeout(() => {
        this.festaService.loadFestas(this.cidadeCodigo).subscribe(
          data => {
            this.loader.dismiss();
            if (data['erro'] == false) {

              this.festa = data.festa;
              this.nomeFesta = data.festa.nome;
              console.log(data.festa);

              let alert = this.alertCtrl.create({
                title: 'Success!',
                subTitle: 'These are the parties happening today in' + this.cidadeCodigo + '.',
                buttons: [
                  {
                    text: 'OK',
                    handler: data => {
                    }
                  }
                ]
              });
              alert.present();
            } else {
              this.naotem = '1';
              let alert = this.alertCtrl.create({
                title: 'Success!',
                subTitle: 'No parties found today in' + this.cidadeCodigo + '.',
                buttons: [
                  {
                    text: 'OK',
                    handler: data => {
                    }
                  }
                ]
              });
              alert.present();
            }
          },
          err => {
            console.log(err);
          },
          () => console.log('parties loaded')
        );
      }, 2000);
    }

Answer №1

Why not give ion-grid a try in the following way? Let us know how it works out for you.

.html

<ion-content class = "test">
<ion-grid>
    <ion-row>
      <ion-col col-12>
       <ion-refresher (ionRefresh) = "doRefresh ($ event)">
       <ion-refresher-content
      pullingIcon = "arrow-down"
      pullingText = "Pull to refresh"
      refreshingSpinner = "circles"
      refreshingText = "Refreshing ...">
    </ ion-refresher-content>
  </ ion-refresher>
  <ion-searchbar *ngIf = "party"
  placeholder = "Search..."
  [(ngModel)] = "myInput"
  (ionInput) = "onInput ($ event)">
</ ion-searchbar>

  <ion-card *ngFor = "let party of parties" class = "cards card-full" style = "border-color: #ffffff! important;">

    <img class = "card-image" src = "http://example.com/images/{{party.thumb}}" height = "42%" style = "border-color: #ffffff! important;">
    <ion-fab center edge class = "fab-cards">
        <button ion-fab mini class = "fab-button" (click) = "itemTapped ($ event, party)"> <ion-icon name = "add"> </ ion-icon> </ button>
      </ ion-fab>
    <ion-card-content class = "card-content-color padding-grid">
      <ion-grid class = "padding-grid">
        <ion-row>
      <ion-col col-6 col-sm>
      <p class = "p-cards font"> {{party.name}} </ p>
      <p class = "p-cards font"> {{party.start_time}} - {{party.end_time}} </ p>
      </ ion-col>
      <ion-col col-4 col-sm offset-2>
      <p class = "p-cards font"> {{party.club_name}} </ p>
      <p class = "p-cards"> <rating [score] = "party.stars" max = "5"> < / rating> < / p>
      </ ion-col>
        </ ion-row>
      </ ion-grid>

    </ ion-card-content>

    </ ion-card>
   </ion-col>
  </ion-row>
 </ion-grid>
</ ion-content>

your-page.scss

page-my{
    .test {
       ion-grid {
            min-height: 100%;
        }
     }
 }

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

Highchart in ionic 2 not displaying

I inserted code for a highchart on my webpage, but it's not appearing I followed instructions from this video tutorial https://www.youtube.com/watch?v=FSg8n5_uaWs Can anyone help me troubleshoot this issue? This is the TypeScript code I used: ts; ...

Ways to enhance a component by incorporating default properties in React/TypeScript

I am looking to enhance a React/TS component (specifically the @mui/x-data-grid DataGrid) by populating the classes prop with my own application classes. Initially, I thought about creating a new component called CustomDataGrid like this: import React fro ...

Angular 4 yields an undefined result

I'm currently working on this piece of code and I need help figuring out how to return the value of rowData in this scenario. private createRowData() { const rowData: any[] = []; this.http .get(`/assets/json/payment.json`) .toPromise() .then(r ...

Using Angular to Trigger a Keyboard Shortcut with a Button

Currently working on an Angular project that includes an event slideshow feature. Looking to make the slideshow go full screen when a button is clicked (Windows - fn+F11). Any tips on implementing a keyboard shortcut function in Angular? Appreciate any h ...

Displaying user input data in a separate component post form submission within Angular

I recently developed an employee center app with both form and details views. After submitting the form, the data entered should be displayed in the details view. To facilitate this data transfer, I created an EmployeeService to connect the form and detail ...

Discovering Spring Boot Properties Within Angular Application

Situation: One microservice is built using Spring Boot and Angular 8. In the Spring Boot application, there is a properties file called application.yaml with the following content: url-header: http gateway: host: envHost:envPort ui-endpoints: g ...

Is it possible to implement Angular Universal on Github Pages?

Is it doable to Deploy Angular Universal on Github Pages? I've come across some solutions such as angular-cli-ghpages, but from what I understand, these options don't pre-render content for SEO purposes. ...

Array that provides specific data types for indexes

Could be a tricky question or maybe not feasible, but I've been scratching my head over it for quite some time and just can't seem to crack it. Appreciate any help! The T generic creates a union type: const arrayToArray = <T>(values: T[]) ...

Send inputs to an Angular page discretely without them being visible in the URL

We are in the process of developing a standalone Angular web page specifically for password maintenance that will be accessed by all our external applications with login capabilities. Our goal is to streamline the password change process by pre-populating ...

Utilize Angular Service Worker to prefetch API data efficiently (dataGroups)

I am working on an Angular website that needs to function offline. In order to achieve this, I need some data from the API, which can be considered Stale data. To handle this scenario, my approach is to first attempt to retrieve the data from the API, and ...

Address aliases in the webpack configuration file

When utilizing webpack, it is possible to write the configuration file using TypeScript. However, it is crucial to ensure that any alias paths present in the config file are resolved to their mapped paths. It should be noted that this pertains specificall ...

How can I trigger a click event with Ionic's ion-toggle and radio-group components

I am currently using Ionic3 and I would like to implement an HTML element (ion-toggle and radio-group) that triggers a JavaScript function upon clicking. As you can observe below, I have included an attribute ng-click as per the guidance provided here, bu ...

In Angular, what is the best way to update the quantity of an item in a Firestore database?

Whenever I attempt to modify the quantity of an item in the cart, the quantity does not update in the firestore database. Instead, the console shows an error message: TypeError: Cannot read properties of undefined (reading 'indexOf'). It seems li ...

The DatePicker in Angular2 and Typescript is unable to execute the property 'toggle' because it is undefined

I've encountered an issue with the calendar icon for angular2's datepicker. Whenever I try to click on it, I keep getting this error: TypeError: Cannot read property 'toggle' of undefined at Object.eval [as handleEvent] (Admiss ...

Vue.js with TypeScript: The property 'xxx' is not found on the type 'never'

I have a computed method that I am trying to execute: get dronesFiltered(){ const filtered = this.drones.filter((drone) => { return drone.id.toString().indexOf(this.filterId) > -1 && drone.name.toLowerCase().toString().in ...

"Encountered a problem when trying to import stellar-sdk into an Angular

Our team is currently working on developing an app that will interact with the Horizon Stellar Server. As newcomers in this area, we are exploring the use of Angular 8 and Ionic 4 frameworks. However, we have encountered difficulties when trying to import ...

What is the best way to connect an object to an array using ngFor in Angular?

It has been noticed that in Angular, the current variable does not align with the available options. Even though the object { question: 'q3', answer: '' } exists in data.questions, it may not be a direct match. Is there a method to en ...

What is the best way to extract data from a proxy in VUE3?

Currently, I am utilizing the ref() function to store data retrieved from Firebase. However, when attempting to filter and retrieve a single record, the outcome is not as expected. Instead of returning a single object, something different is being displaye ...

What is causing the element to disappear in this basic Angular Material Sidenav component when using css border-radius? Check out the demo to see the issue in action

I have a question regarding the Angular Material Sidenav component. I noticed that in the code below, when I increase the border-radius property to a certain value, the element seems to disappear. <mat-drawer-container class="example-container" ...

Having difficulty retrieving the REST service response in Angular

While I am able to successfully call the REST service within our company's VPN using Firefox and Chrome, I am facing challenges connecting to it from Angular 2. Despite attempting to access the REST service through various methods, I consistently enco ...