giorgosart/react-easy-edit

Access to onSave and onValidate via props in editComponent ?

vnnegt opened this issue · 4 comments

Greetings,

Just wondering if it would be possible to have access to onSave and onValidate via props in a custom editComponent?

For example:

               // EditComponent
                <div>
                    <Input type="text"
                        defaultValue={VALUE}
                        // this will trigger EasyEdit onValidate
                        onBlur={ props.onValidate } />
                </div>
                <ButtonContainer>
                    <PrimaryButton
                         // this will trigger EasyEdit onSave
                         onClick={ props.onSave }>
                         Submit
                     </PrimaryButton>
                </ButtonContainer>
                        <EasyEdit
                            type={Types.TEXT}
                            value={VALUE}
                            onSave={ 
                              // functioned triggered by PrimaryButton onClick
                            }
                            onValidate={
                              // functioned triggered by Input onBlur
                            }
                            allowEdit={editMode}
                            editMode={editMode}
                            hideSaveButton={true}
                            hideCancelButton={true}
                            displayComponent={
                                <CustomDisplay/>
                            }
                            editComponent={
                                <CustomEdit/>
                            }
                        />

Hey @vnnegt thank you for logging this, let me take a look at it and will get back to you

@vnnegt is this something you will be able to implement?

@vnnegt is this something you will be able to implement?

haha i was hoping you would be able to

when i asked the question i was new to react so i was looking for a tool that did everything i needed, but i ended up going another route with my project

@vnnegt I'm closing this request down then..