Skip to content
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

Listening to event names containing a ':' #1273

Closed
btakita opened this issue Mar 23, 2018 · 6 comments
Closed

Listening to event names containing a ':' #1273

btakita opened this issue Mar 23, 2018 · 6 comments

Comments

@btakita
Copy link
Contributor

btakita commented Mar 23, 2018

It seems like the compiler strips the part of the event name from ':' onward.

https://svelte.technology/repl?version=1.58.0&gist=db70c440f307ed3de63da1de70da14cb

@btakita
Copy link
Contributor Author

btakita commented Mar 23, 2018

From the repl above:

<Nested on:event1=event1(event) on:event2:1=event21(event)/>

results in the output:

	nested.on("event1", function(event) {
		component.event1(event);
	});
	nested.on("event2", function(event) {
		component.event21(event);
	});

@dxlbnl
Copy link
Contributor

dxlbnl commented Mar 27, 2018

shouldn't this be a syntax error?

@Conduitry
Copy link
Member

If we're going to do something like #1088, we're going to need some sort of rules about what characters can be in event names.

@btakita
Copy link
Contributor Author

btakita commented Mar 30, 2018

Could we allow a way to support literals in event names? Something like:

<Nested on:"event2:1"=event21(event)></Nested>

@tanhauhau
Copy link
Member

tanhauhau commented Oct 18, 2019

This seemed to be fixed on the latest svelte (3.12.1), repl

@btakita
Copy link
Contributor Author

btakita commented Oct 18, 2019

Indeed! @tanhauhau Thank you for checking. Hopefully there's an automated test for this.

@btakita btakita closed this as completed Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants