Call onBlur on custom Input with Controller to save form #1989
-
I am using latest 6.x version. How can I call onBlur with Controller as Input to handle save form without clicking a button ? I changed mode to This is working and single Input handles <Input
onBlur={() => {
console.log('onBlur');
}}
/> This is not working, <Controller
placeholder={placeholder ? placeholder : resetValue.toString()}
size="small"
as={
<Input
onBlur={() => {
console.log('onBlur on Input');
}}
/>
}
min="0"
onKeyDown={handleKeyDownEnter}
onBlur={() => {
console.log('onBlur on Controller');
}}
type={isInputNumber ? 'text' : 'text'}
className={styles.input_dropdown}
rules={rules}
name={name}
control={control}
/> btw, onKeyDown works and I can save form on catching press Enter key event but I want to do the same Sorry I could not create codesandbox because my custom Input not published anywhere. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
why not using render props? then you will have the full control and assign your action with |
Beta Was this translation helpful? Give feedback.
why not using render props? then you will have the full control and assign your action with
onBlur
.