ioBroker / ioBroker.vis-hqwidgets

High Quality Widgets for ioBroker.vis
MIT License
18 stars 11 forks source link

Add mouseout event to Button widget so Taster works if mouse left the widget while pressed #20

Closed mk176 closed 4 years ago

mk176 commented 4 years ago

If i use a button with "taster" option, i have the following problem:

  1. if "taster" is pressed with mouse inside the "taster" the state becomes true.
  2. if i release the mouse while i am inside the "taster" the state becomes false. 3 if i move the mouse, without releasing the mouse button, out of the "taster" and then release the mouse the state does not revert to false, because the event mouseup is not fired to the widet.

To solve this issue: Change hqwidgets.js and bind mouseout event to object (line 205) Also change eventhandler to work also on mouseout (line 1617)

fu-zhou commented 3 years ago

I still got the problem with the hqwidget "On/Off" - see closed issue #23 (closed by stalebot, not fixed). I checked your fix (line 205, 1617) against the hgqwidgets.js in my /opt/iobroker/node_modules/iobroker.vis-hqwidgets/widgets/hqwidgets/js Line 208 and 209 (marked green rathern than 205) are identical, but line 1617 moved to line1652 in my version. However line 1652 is identical with the line 1617 in your fix: $main.on('mouseup mouseout touchend', function (e) { This is also the only place to find "mouseup mouseout touchend". "mouseup touchend" does not exist.

Could you look into that again? Many thanks in advance...