giorgosart / react-easy-edit

Inline editing library for React
https://giorgosart.gitbook.io/react-easy-edit/
MIT License
252 stars 46 forks source link

Save on blur #105

Closed alexferrari88 closed 4 years ago

alexferrari88 commented 4 years ago

Hi, it would be nice if the field would autosave on blur. This is pretty standard behaviour for many UIs. Is this possible to add?

giorgosart commented 4 years ago

Hey @alexferrari88 yeah it can be added, do you see this as being a prop? What would then happen to the Save button?

alexferrari88 commented 4 years ago

hey @giorgosart, indeed it can be a prop such as saveOnBlur={true}. The Save and Cancel button should disappear. Basically it should happen the same as if the person would have pressed enter or pressed Save.

giorgosart commented 4 years ago

@alexferrari88 check v1.10.0 of EasyEdit, I've added the saveOnBlur prop. Let me know if this works for you!

giorgosart commented 4 years ago

Updated documentation as well https://app.gitbook.com/@giorgosart/s/react-easy-edit/examples/onblur