-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Allow multiple event listeners on a single node #2709
Allow multiple event listeners on a single node #2709
Conversation
I think this sounds like a reasonable enhancement. Can you swap out the parser test though for a runtime test (like the others in |
src/parse/state/tag.ts
Outdated
@@ -376,6 +368,15 @@ function read_attribute(parser: Parser, unique_names: Set<string>) { | |||
const colon_index = name.indexOf(':'); | |||
const type = colon_index !== -1 && get_directive_type(name.slice(0, colon_index)); | |||
|
|||
if (unique_names.has(name) && type != "EventHandler") { |
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.
if (unique_names.has(name) && type != "EventHandler") { | |
if (unique_names.has(name) && type !== "EventHandler") { |
Not that it would really matter here, but we are trying to use non-coercion comparisons everywhere.
src/parse/state/tag.ts
Outdated
}, start); | ||
} | ||
|
||
unique_names.add(name); |
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.
It might be nicer to not even add to unique_names
if we have a type
of "EventHandler"
.
@Conduitry I've implemented your suggestions into the pr. |
Thanks, this is a nice enhancement |
Should the documentation be updated? |
As described in #2688