# Press and hold works on desktop, doesn't work on tablet or phone

**URL:** <https://discourse.nodered.org/t/press-and-hold-works-on-desktop-doesnt-work-on-tablet-or-phone/75468>\
**Category:** Dashboard\
**Created:** [20 February 2023 13:49 UTC](https://discourse.nodered.org/t/press-and-hold-works-on-desktop-doesnt-work-on-tablet-or-phone/75468 "2023-02-20T13:49:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WesleyFranken](https://avatars.discourse-cdn.com/v4/letter/w/51bf81/32.png) [@WesleyFranken](https://discourse.nodered.org/u/WesleyFranken)\
**Post date:** [20 February 2023 13:49 UTC](https://discourse.nodered.org/t/press-and-hold-works-on-desktop-doesnt-work-on-tablet-or-phone/75468/1 "2023-02-20T13:49:38Z")

</div>

Dear community,

I've been stuck on this for a few days now and I'm wondering if there's a fix for my problem.

I've created a dashboard template which controls a sunscreen. When I press and hold it via a desktop PC it works fine but when I try to use it on iPad, iPhone, Flip3 5G or basically any other touchscreen it doesn't work. It seems it doesn't register the touch on the display in order to press the button.

It's the right button on the bottom:

![Schermafbeelding 2023-02-20 143945](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0bb71a81647ad3907adcc74ebc21a1dfe19d80da.png)

```auto
<div class="rounded" style="width: 100%; height: 100%; background-color:#c0392b;">
    <div style="height: 50%" >
        <md-button class="vibrate filled touched smallfont rounded" style="background-color:#c0392b;" ng-mousedown="send({payload: 1})" ng-mouseup="send({payload: 0})" touchstart="send({payload: 20})"> 
            <div class="center" style="width:auto; height:auto;"><ng-md-icon size="50" style="height: auto; width: auto;" icon="format_align_justify"></ng-md-icon></div>
            <div>omhoog</div>
        </md-button>
    </div>
    <div style="height: 50%">
        <md-button class="vibrate filled touched smallfont rounded" style="background-color:#c0392b;" ng-mousedown="send({payload: 2})" ng-mouseup="send({payload: 0})"> 
            <div class="center" style="width:auto; height:auto;"><ng-md-icon size="50" style="height: auto; width: auto;" icon="format_align_justify"></ng-md-icon></div>
            <div>omlaag</div>
        </md-button>
    </div>
</div>

```

Best regards,  
Wesley Franken

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [20 February 2023 18:53 UTC](https://discourse.nodered.org/t/press-and-hold-works-on-desktop-doesnt-work-on-tablet-or-phone/75468/2 "2023-02-20T18:53:05Z")

</div>

Have a look [here](https://discourse.nodered.org/t/momentary-switch-or-button-normally-open/36768) which descibes how to make a momentary button, ie like your Press and Hold. It works both with mouse and touchscreens.

---

<div class="post-metadata">

**Author:** ![WesleyFranken](https://avatars.discourse-cdn.com/v4/letter/w/51bf81/32.png) [@WesleyFranken](https://discourse.nodered.org/u/WesleyFranken)\
**Post date:** [21 February 2023 19:25 UTC](https://discourse.nodered.org/t/press-and-hold-works-on-desktop-doesnt-work-on-tablet-or-phone/75468/3 "2023-02-21T19:25:02Z")

</div>

Dude, I was looking for ages for this answer. Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 March 2023 19:26 UTC](https://discourse.nodered.org/t/press-and-hold-works-on-desktop-doesnt-work-on-tablet-or-phone/75468/4 "2023-03-07T19:26:02Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
