WICG / EventListenerOptions

An extension to the DOM event pattern to allow authors to disable support for preventDefault
Other
1.17k stars 140 forks source link

Request for an Update Demo File to be added to this Repository #37

Closed ghost closed 6 years ago

ghost commented 8 years ago

First I want to say good work to @RByers for creating this API and the video on CNN Demo is pretty amazing!

I have gone through all this repository, all the issues and all the posts in jQuerry, Modernizr and RByers own Github on this topic. I can see very little information about this API doing a search in Google and from reading all the comments there are so many changes in the way to write the API.

The Demo on RByers Github I notice is using the conversation from Modernizr #1894 which I will include here:

var supportsPassive = false;
try {
addEventListener("test", null, { get passive() { supportsPassive = true; } });
} catch(e) {}

['touchstart', 'touchmove', 'touchend', 'wheel'].forEach(function(type) {
// This handler is demonstrating how to (passively) monitor scroll latency.
addEventListener(type, monitoringHandler, supportsPassive ? {passive:true} : false);
});

I understand the concept you are saying here: "Making Touch and Mouse Events Passive to remove the 100mS delay".

Having read the explainer.md a few times I am still confuse by the order of everything and reading all the comments elsewhere is even worse.

Is it possible for you to add a Demo Example of this API to this repository showing us exactly the correct usage.

Thank you in advance.

RByers commented 8 years ago

Thanks for the feedback!

Is it possible for you to add a Demo Example of this API to this repository showing us exactly the correct usage.

Sure, we can do that. It will mostly just be copied and pasted from the explainer, but putting it in the context of a real use case (for example - hiding a tooltip whenever a user touches) may help. Note that there's also this demo page which uses the API, but there's a buch of extra complexity there to implement the various monitor and knobs.

@paulkinlan I could whip something up myself, but I'm sure someone from your DevRel team could do a better job at explaining it in the simplest (and prettiest) possible terms. WDYT?

I understand the concept you are saying here: "Making Touch and Mouse Events Passive to remove the 100mS delay".

Close. There is no fixed "100ms delay" in this context - just whatever delay happens to be caused by script running on the page (hopefully usually 0, but often >500ms on phones during page load in practice).

RByers commented 8 years ago

/cc @KenjiBaheux thoughts?

patrickhlauke commented 6 years ago

Closing this issue, as all work/discussion has migrated to https://github.com/whatwg/dom/