node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

Button - Added additional pointercancel eventlistener

Open JulianStremel opened this issue 1 year ago • 6 comments

Description

I just wanted to make pointerevents more reliably end for hmi applications. So i added the pointercancel event to the button component that activates if the "pointerup" function is enabled. This will fire when closing the window while a button is pressed or other navigation changes happen that would otherwise not fire the "pointerup" event.

Related Issue(s)

No related issue

Checklist

  • [x] No further modifications and updates needed

JulianStremel avatar Nov 20 '24 08:11 JulianStremel

If we are to include this, i suggest we have a "memory"

Sounds reasonable ! I will have a second look at it shortly.

JulianStremel avatar Nov 20 '24 10:11 JulianStremel

@Steve-Mcl after some initial testing i couldnt figure cases out in which a "random" pointercancel would be emitet. I think due to pointercancel beeing a pointerevent it always cancels the active pointer on the pointerdowned element because it obviously needs a pointer to cancel on ... or is my understanding fundamentally wrong ?

JulianStremel avatar Nov 20 '24 12:11 JulianStremel

TBH, I dont know (not played with this event before - just regurgitating what I seen on MDN)

When I get time to pull and test, I will know more.

If however in the meantime you decide to play around some more and find it is not necessary, then thats fine too.

Steve-Mcl avatar Nov 20 '24 14:11 Steve-Mcl

I will have a second look at it shortly.

Have you had the chance to add in the memory proposed by Steve? I think it would be a good catch just in case there are occasions we've not considered where this could mis-fire

joepavitt avatar Dec 02 '24 12:12 joepavitt

@JulianStremel just checking you've seen the above

joepavitt avatar Dec 23 '24 16:12 joepavitt

@JulianStremel just checking you've seen the above

Sorry for the long silence i had to shift focus to some other projects for the last couple of weeks.

I tested a "memory" implementation and that works like expected... but the pointercancel event as described by the mdn docs only ever fires for active pointers so also tracking active pointers would be double the work for no logical reason im my mind.

JulianStremel avatar Dec 26 '24 08:12 JulianStremel