-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add hasPointerCapture #127
Conversation
Preview. |
@@ -1002,6 +1006,7 @@ | |||
<li><a href="https://github.com/w3c/pointerevents/pull/34">Clarify the button value for mouse drag</a></li> | |||
<li><a href="https://github.com/w3c/pointerevents/pull/24">Fix the touch-action processing model for zoom scenarios</a></li> | |||
<li><a href="https://github.com/w3c/pointerevents/pull/13">Add direction-specific touch-action values</a> (pan-left, pan-right, pan-up, pan-down) and clarified behavior of existing pan-x and pan-y values.</li> | |||
<li><a href="https://github.com/w3c/pointerevents/pull/127">Add hasPointerCapture</a></li> |
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.
the revision history is in reverse chronological order, so this should be at the very top of the list
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.
Whoops, thanks.
makes sense to me in principle. random pondering: would we also want a function that lets me query which pointer(s) the element i'm calling the function on has capture for? or is that getting a bit too convoluted? |
<dt><dfn>hasPointerCapture</dfn></dt> | ||
<dd> | ||
<p>Indicates whether the element on which this method is invoked has <a>pointer capture</a> for the pointer identified by the argument <code>pointerId</code>. In particular, returns <code>true</code> if the <a>pending pointer capture target override</a> for <code>pointerId</code> is set to the element on which this method is invoked, and <code>false</code> otherwise.</p> | ||
<div class="note">This method will return true immediately after a call to <a>setPointerCapture</a>, even though that element will not yet have received a <a>gotpointercapture event</a>. As a result it can be useful to detecting <a>implicit pointer capture</a> from inside of a <a>pointerdown event</a> listener.</div> |
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.
"useful to detecting" -> "useful for detecting" or "useful to detect"
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.
Done, thanks.
Do you have a scenario in mind where you would want to know this? We expect this would be used inside an event and you'd be querying against the single pointer ID for that event. |
admittedly no, i don't have a concrete use case in mind - which is probably a good indicator that this would be superfluous. |
Yeah I think the use cases even for this simple API are pretty limited. I think we should add it mainly as a hedge - it makes conceptual sense, has nice symmetry with the existing APIs and so adds very little overall complexity, and there's some reason to believe there may be non-zero value. But for anything more complex I think we should wait for more compelling use cases. Easy to add later though! |
a43f90a
to
61a87d8
Compare
Suggestions applied, any other feedback? |
Looking good to me, fella |
Ok, thanks! Let's land this now then (so I can more easily do the next step) - happy to take additional feedback after the fact. |
Fixes #121
Also cleans up a couple related definitions for easier linking.