docs: add FAQ about custom form control

close #27994
close #24373
This commit is contained in:
afc163 2020-12-15 20:13:59 +08:00
parent e63856ba9c
commit 9948d2f3e6
2 changed files with 12 additions and 0 deletions

View File

@ -427,3 +427,9 @@ React can not get correct interaction of controlled component with async value u
color: rgba(255,255,255,.3);
}
</style>
### `scrollToFirstError` and `scrollToField` not working on custom form control?
See similar issues: [#28370](https://github.com/ant-design/ant-design/issues/28370) [#27994](https://github.com/ant-design/ant-design/issues/27994)
`scrollToFirstError` and `scrollToField` deps on `id` attribute passed to form control, please mark sure that it hasn't been ignored in your custom form control. Check [codesandbox](https://codesandbox.io/s/antd-reproduction-template-forked-25nul?file=/index.js) for solution.

View File

@ -429,3 +429,9 @@ React 中异步更新会导致受控组件交互行为异常。当用户交互
color: rgba(255,255,255,.3);
}
</style>
### 自定义表单控件 `scrollToFirstError``scrollToField` 失效?
类似问题:[#28370](https://github.com/ant-design/ant-design/issues/28370) [#27994](https://github.com/ant-design/ant-design/issues/27994)
滚动依赖于表单控件元素上绑定的 `id` 字段,如果自定义控件没有将 `id` 赋到正确的元素上,这个功能将失效。你可以参考这个 [codesandbox](https://codesandbox.io/s/antd-reproduction-template-forked-25nul?file=/index.js)。