Skip to content

Commit

Permalink
fix(schema-renderer): fix onBlur/onFocus (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored Mar 25, 2020
1 parent 6b74109 commit 1907ed2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/react-schema-renderer/src/shared/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,18 @@ export const connect = <ExtendsComponentKey extends string = ''>(
schemaComponentProps[options.eventName](event, ...args)
}
},
onBlur: () => mutators.blur(),
onFocus: () => mutators.focus()
onBlur: (...args: any) => {
mutators.blur()
if (isFn(schemaComponentProps['onBlur'])) {
schemaComponentProps[options.eventName](...args)
}
},
onFocus: (...args: any) => {
mutators.focus()
if (isFn(schemaComponentProps['onBlur'])) {
schemaComponentProps[options.eventName](...args)
}
}
}
if (isValid(editable)) {
if (isFn(editable)) {
Expand Down

0 comments on commit 1907ed2

Please sign in to comment.