Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Question / Discussion: Break all native input and change events? #1144

Closed
koffeinfrei opened this issue Mar 4, 2022 · 2 comments
Closed

Comments

@koffeinfrei
Copy link
Contributor

koffeinfrei commented Mar 4, 2022

As recently done in #1065 the native input and change events were replaced by custom events. In one of our codebases we heavily rely on the native events. This breaking change requires a major refactoring. We also have cases where we need some information from the native event, which is not possible anymore.

  1. What is the reasoning behind these changes?
  2. Could an alternative be to leave the native events in place, and use other custom events additionally?
  3. Going forward can we expect for more native events to go away? I.e. should we stop relying on native events support altogether?

You mentioned in #977 (comment) to favor the custom events over native events. That's fair enough as a best practice, but I didn't expect you to drop them altogether 😅. I believe that native events should still be available. Carbon react supports the native events too (i.e. exposes the native event properties).

@metonym
Copy link
Collaborator

metonym commented Mar 4, 2022

What are your use cases? Do you use the native event to manually control state? Do you need to prevent the default behavior?

@koffeinfrei
Copy link
Contributor Author

The main use case is to keep track of the changes in a model data structure. For this we use the name and value from the event.target to update the data on change. The new events only provide the value, which requires us to refactor our components to include the name in another way.

Because of the current inconsistency it's unclear which events are forwarded and which are dispatched without looking at the documentation. Relying on the name alone doesn't tell if the event is native or not.
Is the ultimate goal to be consistent in not forwarding native events?

@carbon-design-system carbon-design-system locked and limited conversation to collaborators Aug 4, 2022
@metonym metonym converted this issue into discussion #1420 Aug 4, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants