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

HasManyFields needs update

Open JingyuZ opened this issue 6 years ago • 2 comments

So the current HMF component:

  1. It supports both controlled and uncontrolled ways, but we searched through the code base, HMF has never been used as uncontrolled component…should we get rid of the uncontrolled support or split it out into a separate component? The code can be simplified a lot if we do this.

  2. When we use it as a controlled component, HMF still tries to update the value prop https://github.com/appfolio/react-gears/blob/master/src/components/HasManyFields.js#L78-L82. This being said, we should not need to pass blank function as a prop to HMF, as onAdd callback in its parent component should have already handled how to update its value.

JingyuZ avatar Jan 16 '19 23:01 JingyuZ

Also looks like using reorderable prop causes any inputs being typed to lose focus when typed in, looks like due to re-render of reorderable list. Looks due to this:

https://github.com/clauderic/react-sortable-hoc/issues/120#issuecomment-274082422

gthomas-appfolio avatar Jan 17 '19 04:01 gthomas-appfolio

Focus issue is fixed in #520 , release v14.4.1

gthomas-appfolio avatar Jan 21 '19 16:01 gthomas-appfolio