flowfuse icon indicating copy to clipboard operation
flowfuse copied to clipboard

All ff-button buttons operate on mouse up

Open Steve-Mcl opened this issue 9 months ago • 1 comments

Current Behavior

When right clicking or releasing a mouse button over a button (even if you dont click/mouse-down on the button) it fires the event / operates.

Image

It seems to have been introduced in bbd10e8697369ae5ae163117874ae03cf5b570f2 about 4 months ago

This is a violation of user expectations, a potential for data loss (unintended actions) and is not accessibility friendly

Expected Behavior

Buttons should use @click

Steps To Reproduce

drag you mouse over text and release over an ff-button or right click (for inspection purposes) any ff-button

Environment

  • FlowFuse version: FFC Live/Current
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Steve-Mcl avatar Apr 03 '25 17:04 Steve-Mcl

For reference, this method worked fine for a long time: https://github.com/FlowFuse/flowfuse/commit/06bcaa02ce34a24667ff34c8e00d8695040e1777#diff-5986482d98ad970a36b3b147d316adce0d686df7bc0f8b5d304c37b0beb9e9d4R95-R111

Steve-Mcl avatar Apr 03 '25 17:04 Steve-Mcl

Can we please change this?

Previously, adding ENV VARs was super quick using the accesskey (`ALT+A on windows) - this no longer works since the button has no click handler.

Also, I cannot operate any ff-buttons using traditional keyboard operations (SPACEBAR) - this is on top of the weird behaviour like right click to inspect operates our buttons, and dragging across text and accidentally lifting your finger off the mouse button over a destructive operation button and it get triggered.

Steve-Mcl avatar Jul 22 '25 15:07 Steve-Mcl

As discussed on Slack, simply replacing the mouse-up with mouse-down will likely not suffice ether since I don't think standard / expected keyboard operations will work correctly with mouse down either.

Take for example tab-stop onto a button/checkbox/dropdown/etc, press space to operate has been a thing since the invention of the (G)UI (GUI form elements, web controls, etc) (or at least in every OS and browser I have used since the days of Win 3.x) Additionally, right click to inspect would still trigger a button. Its just unexpected. Not great UX IMO.

PS: I think this is somehow related to the whole Middle click" to open a device-agent editor or instance editor in new window somehow - we will need to check/handle these operations with whatever solution is created.

Steve-Mcl avatar Jul 22 '25 16:07 Steve-Mcl