24
Views
3
Comments
Solved
Long press button increments number
Question
Application Type
Mobile
Platform Version
11.10.1 (Build 23852)

Searching the forum and the components of Outsystems, I didn't find much on the topic.  

Someone has already implemented a long press in button.  In the test I'm doing, I use touch start and touched, in touch start I put the JavaScript function with the timeout and interval and the action of increasing the number.  

But after the user removes the long press the value still continues to increase even with the clear timeout.

  Any ideas or suggestions to implement? 

Rank: #70
Solution

Hi Daniela,


You can also check the Increment Number Long Press component that implements your requirement.


Regards,
João

Rank: #70
Solution

Hi Daniela,


I think you are following a good approach but perhaps you are forgetting about saving the interval id created on OnTouchStart to clear on OnTouchEnd?

I manage to have it working and this is what my OnTouchStart looks like:


Note that I save on the TimeoutId variable the interval I create so on the OnTouchEnd I can clear it. This is what my OnTouchEnd looks like:


Hope it helps.


Kind regards,
João

Rank: #70
Solution

Hi Daniela,


You can also check the Increment Number Long Press component that implements your requirement.


Regards,
João