# Modal present/dismiss slow to process

**URL:** <https://forum.ionicframework.com/t/modal-present-dismiss-slow-to-process/57719>\
**Category:** ionic-v3\
**Created:** [July 17, 2016, 5:22am UTC](https://forum.ionicframework.com/t/modal-present-dismiss-slow-to-process/57719 "2016-07-17T05:22:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldebeasi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ldebeasi/32/147501_2.png) [@ldebeasi](https://forum.ionicframework.com/u/ldebeasi)\
**Post date:** [July 17, 2016, 5:22am UTC](https://forum.ionicframework.com/t/modal-present-dismiss-slow-to-process/57719/1 "2016-07-17T05:22:05Z")

</div>

I have a small list of items, and tapping each item will display a modal. There is very noticeable delay (~600ms) from when my doModal function is fired and when the modal actually shows up on screen. doModal() simply sets up a modal and makes the call to present it. I’ve been looking at the Timeline views in Chrome and Safari, and both indicate that “drainMicroTaskQueue” is taking quite a long time to display a fairly simple modal. There is a smaller, yet noticeable delay of about 300ms when dismissing a modal. The modal has very little HTML and CSS, so painting isn’t a major issue here.

This is tough to reproduce and give a running example of since this issue really only occurs when compiling and running the app on a phone.

Does anyone have any performance tips when it comes to displaying/dismissing modals? I have a feeling this is more of an Angular 2 concern, but I’m hoping maybe someone could provide some guidance.

---

<div class="post-metadata">

**Author:** ![lloydv](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lloydv/32/102178_2.png) [@lloydv](https://forum.ionicframework.com/u/lloydv)\
**Post date:** [August 5, 2016, 6:01am UTC](https://forum.ionicframework.com/t/modal-present-dismiss-slow-to-process/57719/2 "2016-08-05T06:01:10Z")

</div>

I was having (maybe?) the same problem.

Turns out this is a 300ms delay enforced by the browser itself.

> **[The 300 ms Click Delay and iOS 8 -](https://developer.telerik.com/featured/300-ms-click-delay-ios-8/)**
>
> TJ VanToll explains the current state of the 300 ms delay in current mobile browsers and the unusual situation in Safari on iOS 8, including UIWebView.

Switching from (click) events to (touchend) made the lag disappear, but I’m not sure if this is an acceptable final solution or not. Good enough for now, anyway.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ldebeasi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ldebeasi/32/147501_2.png) [@ldebeasi](https://forum.ionicframework.com/u/ldebeasi)\
**Post date:** [August 7, 2016, 4:08am UTC](https://forum.ionicframework.com/t/modal-present-dismiss-slow-to-process/57719/3 "2016-08-07T04:08:09Z")

</div>

I ended up using (touchend) as well as the “tappable” property, and that seemed to do the trick!

Source: [http://ionicframework.com/docs/v2/faq/#click-delays](http://ionicframework.com/docs/v2/faq/#click-delays)

Thanks for your help!
