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

Need to click twice to select item from slide menu in iOS app #11423

Closed
Gurjit-ONEBCG opened this issue Apr 28, 2017 · 6 comments
Closed

Need to click twice to select item from slide menu in iOS app #11423

Gurjit-ONEBCG opened this issue Apr 28, 2017 · 6 comments

Comments

@Gurjit-ONEBCG
Copy link

Ionic version:
Ionic Framework Version: 3.0.1

When I click on item from ionic slide menu, it doesn't work on first click
It works on second and sometimes on third click.
The same application is working fine in android

Current behavior:
Slide menu item's click work on second time or third time

Expected behavior:
It should work on first click in iOS app as well

Related code:
In app.html code

<ion-menu id="loggedInMenu" [content]="content">

<ion-item detail-push menuClose (click)="next()">

willy.dee

<ion-item detail-push class="item-height" menuClose *ngFor="let p of loggedInPages" (click)="openPage(p)">

{{p.title}}

</ion-list>

In app.component

export class MyApp {
@ViewChild(Nav) nav: Nav;
rootPage:any = SystemIdentifierPage;
loggedInPages: Array<{ title: string, icon: string, component: any }>;

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,
public menu: MenuController) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
this.loggedInPages = [
{ title: 'Home', icon: 'home', component: Home },
{ title: 'Message', icon: 'mail', component: MessagePage },
{ title: 'Entries', icon: 'paper', component: EntriesPage },
{ title: 'Pending Entries', icon: 'document', component: PendingEntriesPage },
{ title: 'Employees', icon: 'people', component: EmployeesPage },
{ title: 'Clients', icon: 'person', component: ClientList },
{ title: 'Search', icon: 'search', component: MySearch },
{ title: 'Logout', icon: 'log-out', component: LoginPage }
];
this.menu.enable(true, 'loggedInMenu');
}

@chandanch
Copy link

@Gurjit-ONEBCG For elements that are not clickable there is a delay of 300ms for the click event to file.
You will need to make it as a button and add the ion-item property to it.
Refer to this code:

<ion-menu>
  <ion-list>
    <button ion-item (click)="openPage1(p)">Item 1</button>
    <button ion-item (click)="openPage2(p)">Item2</button>
    <button ion-item (click)="openPage3(p)">Item3</button>
  </ion-list>
</ion-menu>

For more info refer to this link: http://ionicframework.com/docs/troubleshooting/#click-delays

@jgw96
Copy link
Contributor

jgw96 commented Apr 28, 2017

Hello @Gurjit-ONEBCG , could you try @chandanch solution and see if that solves the issue for you? Thanks!

@Gurjit-ONEBCG
Copy link
Author

Gurjit-ONEBCG commented Apr 30, 2017

Thanks < button > worked in my case.

@daveshirman
Copy link

It should probably be mentioned more clearly in the documentation, especially on the menu component that adding the tappable attribute fixes this. It's too easy to miss in the docs.

@jgw96
Copy link
Contributor

jgw96 commented May 2, 2017

Thanks all! @daveshirman ill talk to the docs people about this.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants