# Text highlighting on button hold

**URL:** <https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 3, 2023, 6:18pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388 "2023-08-03T18:18:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [August 3, 2023, 6:18pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/1 "2023-08-03T18:18:55Z")

</div>

Hi,

I have a few buttons that are designed to be held down for a period of time, and then released. However when the user holds on the text of the button, the button gets released and the text gets highlighted. I can't seem to disable the text highlighting on buttons, I would imagine there is a way to inject some CSS into the styling or ideally the style class but cannot figure out where to do that at. Any direction would be great, thanks in advance.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 3, 2023, 6:23pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/2 "2023-08-03T18:23:56Z")

</div>

> [@Colin\_Quinn](#):
>
> buttons that are designed to be held down for a period of time

Yeah, don't. If you are trying to do a jog operation, you should know that it cannot be made safe to do from Perspective. (And [is difficult outside Perspective, too](https://forum.inductiveautomation.com/search?q=stuck%20momentary).)

---

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [August 3, 2023, 6:27pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/3 "2023-08-03T18:27:37Z")

</div>

Unfortunately I was just the one told to design something to be a momentary button without any input on the design choices... I have something in place that _works_ but only when the text does not get highlighted..

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 3, 2023, 6:28pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/4 "2023-08-03T18:28:53Z")

</div>

There's a reason Perspective does not offer a momentary pushbutton, at all. Cobbling one together is not a good idea.

If you absolutely must have one, deploy Vision and use one of the continuous incrementing write techniques to make the complete comms path reliable.

---

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [August 3, 2023, 6:33pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/5 "2023-08-03T18:33:29Z")

</div>

Correct, I agree pushbuttons in general are a bad idea. However that is not what I am inquiring about.

I would like to know if there is a way to include CSS styling in style classes so that I can turn off the highlighting of button text when it gets held down. This is useful for many things related to usability.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 3, 2023, 6:35pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/6 "2023-08-03T18:35:28Z")

</div>

If you insist on pursuing this you could try using a coordinate view and placing a button without text and a transparent fill over a label with the required background.

If you're using this for a jog function, or similar, then make sure the PLC switches off the output after the maximum safe time. You might want to get someone in management to sign off on the risk that you are introducing at their request.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 4, 2023, 7:06am UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/7 "2023-08-04T07:06:54Z")

</div>

i dont really have this highlighting issue.  
anyways you could try adding adding this to styles  
`user-select: none`

---

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [August 7, 2023, 2:05pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/8 "2023-08-07T14:05:22Z")

</div>

This works great, especially in conjunction with `stylesheets.css` that lets you append true CSS to already existing style classes. Thanks!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 7, 2023, 2:49pm UTC](https://forum.inductiveautomation.com/t/text-highlighting-on-button-hold/77388/9 "2023-08-07T14:49:22Z")

</div>

Btw note that this may not behave everywhere the same, some browsers cascade this effect to all nested childeren, some don't,

So you might need to find the correct css selector for some components.

This also is no form of security
