-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include event.detail in click and dblclick events #1156
base: master
Are you sure you want to change the base?
Include event.detail in click and dblclick events #1156
Conversation
From the documentation linked:
From some quick experimentation, successive clicks on a button with a click handler yielded an Knowing that, I would expect that we wouldn't always want
I haven't tested this, but it sounds like the |
@@ -33,6 +33,7 @@ export function __click__( | |||
element: Element | Document | Window, | |||
options: MouseEventInit | |||
): void { | |||
options = { ...options, detail: 1 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://github.com/emberjs/ember-test-helpers/blob/master/API.md#click
I believe this would be a breaking change as users could no longer override detail
on the event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya, you'd have to do it the other way around (so the users provided detail
option "wins"):
options = { ...options, detail: 1 }; | |
options = { detail: 1, ...options}; |
The spec here sounds confusing but the increment is happening. Because mouse down and mouse up trigger before click they start at 0 (click) + 1, then 1 click + 1 etc. |
This change updates UIEvent.detail (https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail) on
click
anddblclick
events.