ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Google Map and Searchbar - Idle event is triggered after searchbar is in focus

Open zywh opened this issue 10 years ago • 4 comments

Short description of the problem:

Searchbar or text box in header. Googlemap in ion-context (100%). Focus on searchbox trigger google map idle event and focus is moved out of searchbox. Basically you can't input any text

  1. It has no problem in broswer testing
  2. It has no problem with compiled IOS app
  3. It only happens in APK

What behavior are you expecting?

Steps to reproduce: Use conference app as template. Modify map page with following

  1. add searchbox in header
<ion-header>
  <ion-navbar>
    <button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
     <ion-searchbar></ion-searchbar>
  </ion-navbar>
</ion-header>

<ion-content class="map-page">
  <div id="map"></div>
</ion-content>

  1. add map idle listener in ionViewLoaded()
google.maps.event.addListener(map, 'idle', () => {
    this.presentToast();
  });
  1. create toast message if idle event is triggered so we know idle event is triggered
presentToast() {
    let toast = this.toastCtrl.create({
      message: "loading",
      duration: 1000,
      position: 'bottom'

    });


    toast.present();
  }

  1. ionic build android ... load it in android. Focus on searchbar in map page. Toast is triggered and focus is out

of course import ToastController add it into constructor


import { NavParams ,ToastController} from 'ionic-angular';
constructor(public confData: ConferenceData,private toastCtrl: ToastController) {}


Version: Ionic V2 Beta 11

It was OK in beta 7 or 8. Don't recall when it starts. I tried any things. Add padding-top to ion-content... It doesn't help. Don't understand why focus on text area will trigger map event

zywh avatar Aug 26 '16 00:08 zywh

APK to download

https://rink.hockeyapp.net/apps/d60115b2914a4e45b7975151ef08e8b9/app_versions/1

Gihub Code

https://github.com/zywh/ionic-conference-app/tree/master/app

zywh avatar Aug 26 '16 00:08 zywh

Simple question: May a z-index change the behaviour? I remember something like this in the cordova plugin, but can't find the issue or thread regarding it by now :(

sr972 avatar Aug 26 '16 13:08 sr972

I tried to move search box to modal page (popup over map page). It should have higher z-index. Although modal page hide entire map page under . focus on searchbox still trigger map event.

I even tried to limit size of ion-content div to much smaller size without overlapping header . It still trigger . It drives me nuts-:(

Sent from my iPhone

On Aug 26, 2016, at 9:51 AM, sr972 [email protected] wrote:

Simple question: May a z-index change the behaviour? I remember something like this in the cordova plugin, but can't find the issue or thread regarding it by now :(

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

zywh avatar Aug 26 '16 20:08 zywh

Hello all! As this seems like more of an issue with the google maps plugin and not the Ionic framework I am going to be closing this issue for now. Thanks for using Ionic!

jgw96 avatar Sep 01 '16 20:09 jgw96