Skip to content

Add optional naming for stopPropagation & preventDefault pipes on event listeners #9317

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

Closed
Serpentarius13 opened this issue Oct 15, 2023 · 2 comments

Comments

@Serpentarius13
Copy link

Describe the problem

Hey, would it be possible to reduce the typing for every listener with adding two lines of code? Im a Vue dev originally and I love how they did their piping system: https://vuejs.org/guide/essentials/event-handling.html#event-modifiers, especially shorthand naming for preventDefault -> .prevent & stopPropagation -> stop. It may be some bikeshedding, but why not? =)

Describe the proposed solution

I think it just could be done by adding OR statement here:

if (this.node.modifiers.has('preventDefault')) snippet = x`@prevent_default(${snippet})`;

Alternatives considered

Its just what it is

Importance

nice to have

@Prinzhorn
Copy link
Contributor

#3372 (comment) and following

@Serpentarius13
Copy link
Author

#3372 (comment) and following

I see, thanks for pointing out!

@gtm-nayan gtm-nayan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants