Closed RByers closed 8 years ago
I actually tend to agree with Olli's desire for a more general name. My intuition is that we will find other non-scroll-related uses for this in the future. How about "blocksDefaultAction"? That clearly associates with preventDefault, would also be usable in the future for the scroll event handler case you mention and would hopefully avoid the potential confusion I mention in #13.
I'm trying to separate a bit the debate over the right name / spec wording (#13) from the fundamental semantics (this bug). It sounds like 'blocksDefaultAction' would have more of the semantics I'm proposing here for blocksScroll, right? Eg. what would the behavior be for events like 'scroll' and 'mousemove' which have no default action - do we need some mechanism to indicate failure? What would the default value be when unspecified (do we need to reintroduce a third "auto" value)?
Also I'm not sure "blocksDefaultAction" would really make sense for "scroll". I don't think we could add a default action to "scroll" - what would it mean for the page to call preventDefault on it (we can't, for example, undo the scroll)? But maybe we could fudge it to be close enough?
indicate failure? What failure? There isn't anything to cancel on "scroll". "scroll" event happens after actually scrolling.
Right, my point exactly. So you're suggesting that blocksDefaultAction=true
for scroll
or mousemove
events would be silently ignored since there is no default action, right? Ojan was suggesting that we might want to use blocksDefaultsAction=true
on scroll
events in the future to enable JS synchronized scrolling (one of my original goals with scroll-blocks-on
but not something I'm actively pursuing at the moment).
@esprehn says:
I don't like making this specific to scrolling, that doesn't explain what it really means in terms of the capabilities of the event handler. We probably want to use this for other event types where we want to change the time the event dispatches based on if you require the ability to cancel or not as well.
Consensus seems to be to stick with the general semantics of mayCancel
(but we can still debate the exact name in #13).
My original proposal on public-pointerevents suggested a
blocksScroll
option instead of thismayCancel
option. Maybe that would be better after all?Benefits:
preventDefault
but would still want to block scrolling.Disadvantages:
mayCancel
?Previously Olli Pettay argued:
And then
Anyone else have opinions here?