Skip to content

Commit

Permalink
fix(antd): fix error auto scroll is not work for antd4 (#750)
Browse files Browse the repository at this point in the history
* fix(schema-renderer): fix onBlur/onFocus

* fix(antd): fix v4 error scroll
  • Loading branch information
janryWang authored Mar 25, 2020
1 parent 2f0c25f commit 9d0f219
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/antd/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const autoScrollInValidateFailed = (formRef: any) => {
if (formRef.current) {
setTimeout(() => {
const elements = formRef.current.querySelectorAll(
'.ant-form-item-control.has-error'
isAntdV4
? '.ant-form-item-has-error'
: '.ant-form-item-control.has-error'
)
if (elements && elements.length) {
if (!elements[0].scrollIntoView) return
Expand Down

0 comments on commit 9d0f219

Please sign in to comment.