Closed AaronJY closed 6 months ago
@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
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.
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.)
Sorry this somehow slipped. Just a note that in v2 this is very simple via event modifier:
<button click.trigger:left="onLeftClick()">
All good! I was just cleaning up some of my stale open issues.
I'm submitting a bug report
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 FirefoxExpected/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.