binding icon indicating copy to clipboard operation
binding copied to clipboard

click.delegate firing for all clicks on firefox rather than just left click

Open AaronJY opened this issue 6 years ago • 3 comments

I'm submitting a bug report

  • Library Version: 2.1.1

Please tell us about your environment:

  • Operating System: Windows 10

  • Node Version: 6.7.0

  • NPM Version: 3.10.3
  • JSPM OR Webpack AND Version webpack 3.4.1
  • Browser: Firefox 66.0.3

  • Language: TypeScript 2.6.2

Current behavior: When I click an element with a click delegate (click.delegate), the handler fires for all click types (left, right, middle) but only of Firefox

Expected/desired behavior:

  • What is the expected behavior? When I click an element with a click delegate, I expect only a left click to trigger the handler on Firefox.

  • What is the motivation / use case for changing the behavior? It's inconsistent with the way other browsers handle the click binding.

AaronJY avatar May 02 '19 17:05 AaronJY

@AaronJY thanks for filing this bug. It's interesting that FF behaves differently. I'm not sure how we should fix it, adding a check just for quirky browsers or doing something else?

cc @fkleuver @EisenbergEffect

bigopon avatar May 09 '19 11:05 bigopon

No worries. I think a quick check on the value of event.which from the click event would be adequate enough on the surface, though I'm not sure if there's something crazier going on that is impacting FF specifically that needs to be addressed 🤔 If anybody with more experience with the code could shed some light before I start digging that would be ideal - happy to take a look myself though!

It's worth mentioning that I've tested the behavior on the latest version of Aurelia as well, so we're sure it's not been fixed in a later version! Here's a sandbox with an example: https://codesandbox.io/s/001jo2ql7l

Only left-clicking the Trigger link will update the textbox, however any clicks on the Delegate link will update it.

AaronJY avatar May 09 '19 11:05 AaronJY

Interesting. It's funny we hadn't hit this before now. I wonder if it was a change in FF or if nobody just really cared which mouse button triggered it before. We could definitely add a check on which of click events. @bigopon What do you think? (We'd also need to port this over to vNext if we do that.)

EisenbergEffect avatar May 14 '19 01:05 EisenbergEffect

Sorry this somehow slipped. Just a note that in v2 this is very simple via event modifier:

<button click.trigger:left="onLeftClick()">

bigopon avatar Feb 29 '24 10:02 bigopon

All good! I was just cleaning up some of my stale open issues.

AaronJY avatar Feb 29 '24 10:02 AaronJY