ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.56k stars 784 forks source link

bug: All @Events are cancelable by default when component may not necessarily support event cancelation #3500

Open jcfranco opened 2 years ago

jcfranco commented 2 years ago

Prerequisites

Stencil Version

2.17.1

Current Behavior

Any custom event created with @Event is set as cancelable: true by default. Developers should explicitly make an event cancelable once a component supports cancelation.

One side-effect from this is that anything derived from the docs-json output target can be misleading. For example, we use the docs-json output file to create custom doc pages and there was some confusion about event cancelation as they were all documented as such, but only a handful were truly cancelable (see https://github.com/Esri/calcite-components/issues/3967 for more info).

Expected Behavior

Events are not cancelable by default.

Steps to Reproduce

See steps in readme from https://github.com/jcfranco/stencil-all-events-cancelable-by-default

Code Reproduction URL

https://github.com/jcfranco/stencil-all-events-cancelable-by-default

Additional Information

No response

tanner-reits commented 2 years ago

Hey @jcfranco 👋

Sorry for the delay on this. I was able to confirm we default events as cancelable and that is getting reported in the generated documentation JSON files. I'll get this labeled so it's pulled into our backlog and we can discuss as a team. Thanks for reporting the issue!