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

Syntax to bind events in JSX is confusing with snake-case #474

Open
catwell opened this issue Aug 12, 2019 · 0 comments
Open

Syntax to bind events in JSX is confusing with snake-case #474

catwell opened this issue Aug 12, 2019 · 0 comments

Comments

@catwell
Copy link

catwell commented Aug 12, 2019

I wanted to bind an event from an external component library that uses snake-case. The event is called selected-index-changed. I tried this:

<elix-list-combo-box onSelectedIndexChanged={...}>

... but it turns out that doesn't work and the correct syntax is the weird-looking:

<elix-list-combo-box onSelected-index-changed={...}>

Is there any way to make this look better? I can see three options:

  • Make the first thing I attempted work.
  • Make on-selected-index-changed work.
  • Use a different syntax that uses the name of the event unchanged, e.g. what Angular does:
<elix-list-combo-box (selected-index-changed)={...}>
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

1 participant