Fire action when user changed input but not when changed remotely


I have a range input. Value of this input can be set by an incoming event (websockets) and by user interaction. When user changes this value I want to fire an action, but I don’t want it when value is changed remotely. I workaround it this way:

Do you know of any clear way of achieving that?


Checking old/new values is a good solution

How about if the component only updates the range value after the “onmouseup” event has fired on the element, that should mean the socket can update the value but not trigger any events.


I was afraid that it won’t work on mobile, but actually tapping on mobile fires “mouseup” event so it works fine (at least on latest chrome). Thanks.

I think it’s a common scenario to control input from few sources (by user interaction and remotely), so I thought it’s already solved in some nice manner.