# Perspective Mouse event, disable cut/copy/paste on iPad

**URL:** <https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650>\
**Category:** Ignition Early Access\
**Created:** [June 7, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650 "2019-06-07T18:35:55Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [June 7, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/1 "2019-06-07T18:35:55Z")

</div>

We use a lot of mousedown/mouseup events on our old mobile module on Ignition v7.9. This allows us to set a OPC tag to 1 on mousedown, and then 0 on mouseup. (Moving equipment from iPad screen). I’m trying to recreate this on perspective.  
I use the onTouchStart event and onTouchEnd event to accomplish this. I couldn’t get the onMousedown and onMouseUp events to work with Perspective properly. While it works, since now it’s HTML5 i guess, I can get a popup on the iPad when I hold down the button. This popup is prompting me to select the item/button and cut/copy/paste text. I read that there is a way to disable this popup on mobile version of safari using css, but I can’t find in perspective where you can inject custom css. Anybody have any ideas or solutions to this? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![PerryAJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/perryaj/32/3281_2.png) [@PerryAJ](https://forum.inductiveautomation.com/u/PerryAJ)\
**Post date:** [June 7, 2019, 7:35pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/2 "2019-06-07T19:35:49Z")

</div>

There are 3 ways to affect the CSS in Perspective. I’ll focus on two, since the third (theme css) is still a work in progress.

1. Style Properties - these are the values that you add to a component’s `style` property
2. Named Styles - these are the _Style_ resources you can create and add to a component’s `style.classes` array.

Which (if either) will work for you really depends on what CSS you’re specifically looking to add, as neither supports all possible CSS selectors/functions.

What CSS are you looking to add?

If neither of those work, we can talk about the theme css, but I’m a little hesitant to go there since that system is changing. Since it’s not technically a documented/supported feature yet, there’s a chance that changes there right now would be lost there on upgrade.

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [June 10, 2019, 11:17am UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/3 "2019-06-10T11:17:52Z")

</div>

From searching the web, here is a way to disable the select feature (on mobile safari at least).

-webkit-user-select: none;

Not sure which place this CSS code would go?

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [June 10, 2019, 11:48am UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/4 "2019-06-10T11:48:03Z")

</div>

Sorry about this. I just answered my last question. I added a new ‘value’ to the button called, ‘-webkit-user-select’, then set the actual value to ‘none’ and it worked! Thanks for your help!

---

<div class="post-metadata">

**Author:** ![mblystone](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@mblystone](https://forum.inductiveautomation.com/u/mblystone)\
**Post date:** [March 30, 2021, 4:06pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/5 "2021-03-30T16:06:37Z")

</div>

Hey Micah,

Where exactly did you add this property? I can’t seem to get this solution to work.  
Did you have to bind it to another property once you created it?

Hopefully this post isn’t too old to for a reply.

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [March 30, 2021, 4:52pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/6 "2021-03-30T16:52:43Z")

</div>

Well I just went through all of my code, which to my knowledge has been working for years, and now I can’t find that piece of code anywhere lol. go figure. Where I think would be most logical is under the style props of the button. Add a custom ‘value’ and set it to ‘webkit-user-select’ and set the value to ‘none’. I’m still looking for where I put that code and if I find it I’ll write back.

---

<div class="post-metadata">

**Author:** ![mblystone](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@mblystone](https://forum.inductiveautomation.com/u/mblystone)\
**Post date:** [April 1, 2021, 3:57pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/7 "2021-04-01T15:57:00Z")

</div>

Thanks for the reply! Was very surprised to see this today haha

Yup, that is the most logical spot I could think to put it as well. Weird that it doesn’t work for me.

Weirder still is that this is the only thread I can find on the whole of the Internets that pertains to this issue. I may submit a ticket today, I usually get a response within a day or so.

I’ll let you know what they say if you’re curious.

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [April 3, 2021, 2:36pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/8 "2021-04-03T14:36:36Z")

</div>

Yes I am definitely interested. I also agree that it is weird there are not more instances of this across the Internet. I found that answer on a web development forum a couple years ago and when I tested it , it did work, it was just a question of how to fit it into ignition.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [April 23, 2021, 3:36pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/9 "2021-04-23T15:36:38Z")

</div>

For those who find this thread: Adding an Object Member value called “user-select” to the “textStyle” PROPS and setting the value to “none” should work.

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [April 26, 2021, 11:42am UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/10 "2021-04-26T11:42:40Z")

</div>

I tried this and it didn’t work for me. The user still gets the popup to copy/paste on the iPad. I also tried webkit-user-select:none as well. Evidently whatever I did in the past didn’t carry over and the operators still experience this issue so I’d love to hear an answer for this.

---

<div class="post-metadata">

**Author:** ![Chris\_Kociolek](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@Chris\_Kociolek](https://forum.inductiveautomation.com/u/Chris_Kociolek)\
**Post date:** [April 5, 2022, 1:07pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/11 "2022-04-05T13:07:53Z")

</div>

The style properties you need to remove this annoying touch feature on an IOS device are:  
-webkit-touch-callout: none;  
and  
-webkit-user-select:none;

Unfortunately, Ignition designer won’t allow you to add a style property that begins with a hyphen, so you have to manually add to an Ignition CSS file on your gateway.

For windows:  
C:\Program Files\Inductive Automation\Ignition\data\modules\com.inductiveautomation.perspective\themes\

For RPI:  
opt/Ignition/data/modules/com.inductiveautomation.perspective/themes/

For me, I’m using RPI and will only be using Ignition for my home automation app. Therefore, I just placed the following in the light theme entry point file light.css:

\* {  
-webkit-touch-callout: none;  
-webkit-user-select:none;  
}

The \* means the styling will apply to every component in the DOM.

---

<div class="post-metadata">

**Author:** ![PerryAJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/perryaj/32/3281_2.png) [@PerryAJ](https://forum.inductiveautomation.com/u/PerryAJ)\
**Post date:** [April 7, 2022, 8:42pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/12 "2022-04-07T20:42:37Z")

</div>

Thanks for the added comment Chris. Themes hadn’t yet stabilized when I originally replied, so I appreciate the addition for future users.

---

<div class="post-metadata">

**Author:** ![Chris\_Kociolek](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@Chris\_Kociolek](https://forum.inductiveautomation.com/u/Chris_Kociolek)\
**Post date:** [April 11, 2022, 12:27pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/13 "2022-04-11T12:27:04Z")

</div>

No worries Perry. Yes, I thought it was worth adding the fix since it would be happening to everyone running a perspective apps on a touch iOS device.

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [April 11, 2022, 1:02pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/14 "2022-04-11T13:02:14Z")

</div>

Thank you so much! This solved my issue.

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [December 9, 2022, 6:37pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/15 "2022-12-09T18:37:06Z")

</div>

```auto
* {
-webkit-touch-callout: none;
-webkit-user-select:none;
}

```

I'm unable to get this working by adding to my themes file. I'm trying to prevent these popups on numerical entry fields. I have successfully added other things, but the popups for Cut, Copy, etc.. still come up in my iOS, did something change?

\*Update - this may be due this not working on iOS 16.

---

<div class="post-metadata">

**Author:** ![micah.hastings](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@micah.hastings](https://forum.inductiveautomation.com/u/micah.hastings)\
**Post date:** [December 12, 2022, 4:49pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/16 "2022-12-12T16:49:16Z")

</div>

Make sure you are adding it to the right theme file. For example, in my case, I had to add it to  
C:\program files\inductive automation\Ignition\data\modules\com.inductiveautomation.perspective\themes\light.css

Here is a screenshot of that file for me:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed16be27ba1050ecc933cb00bcc9b37c8cd6da4d.png)

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [December 13, 2022, 6:52pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/17 "2022-12-13T18:52:16Z")

</div>

Thanks, I made sure it was in the correct one, even trying all others. We are using light-warm, so I put it there and confirmed in the Chrome browser developer that the css shows the entries I made. However, I wonder if it doesn't work on iOS 16+? Note that we all have iPhone's using the Perspective iOS app.

---

<div class="post-metadata">

**Author:** ![Chris\_Kociolek](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@Chris\_Kociolek](https://forum.inductiveautomation.com/u/Chris_Kociolek)\
**Post date:** [January 3, 2023, 12:43pm UTC](https://forum.inductiveautomation.com/t/perspective-mouse-event-disable-cut-copy-paste-on-ipad/25650/18 "2023-01-03T12:43:31Z")

</div>

I’m using IOS16.1.2 with the iOS perspective app and it’s still working for me.

Is your gateway running on a different machine from your designer? If so, the CSS files will be located on both machines. You need to make the change on the gateway machine.
