react-toolkit icon indicating copy to clipboard operation
react-toolkit copied to clipboard

[Form] onBlur events are not consistents with onChange events

Open xballoy opened this issue 5 years ago • 4 comments

In withInput.js we override the default event for onChange so we don't have to deal with event.target.value and event.target.id. However when we want to use onBlur on the same input we don't have this new event so the code is not consistent when we want to use both.

I would like to have the same behavior on both events.

Some things to take into considerations:

  • this change would be a breaking change
  • what about all the other events
  • the same kind of thing is done in withClickId.hoc.tsx

Because this is not even documented, I think it would be better not to do that anymore and use the "standard" events.

What do you think?

I'm open to work on both solutions.

xballoy avatar Sep 27 '19 13:09 xballoy

I have that problem in mind since a long time. I'am agree with you. It would make the toolkit more understandable and remove problems to return the standart event.

We have to discuss more about it.

guillaumechervetaxa avatar Sep 27 '19 14:09 guillaumechervetaxa

It is a big breaking change, May be we need to finish typescript migration in order to help client to migrate. What do you think ?

guillaumechervetaxa avatar Sep 27 '19 15:09 guillaumechervetaxa

Yes it's a big breaking change, we'll need to bump the major of the toolkit for this one. If we finish the TypeScript migration of the form package it will be easier for the client to migrate so we should wait for it.

You can assign this one to me and I can work on the migration of the form package to TypeScript if no-one is working on it.

xballoy avatar Sep 27 '19 15:09 xballoy

No one is working on the migration of the form package. You can take it ! We can add some github card about it on monday if you want.

I know @arnaudforaison worked on the Collapse, but he never pushed it.

guillaumechervetaxa avatar Sep 27 '19 15:09 guillaumechervetaxa