Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Set fields by kv object. each field can contain errors and value member.
Validate and get fields value by fieldNames.

options is the same as validate method of [async-validator](https://github.com/yiminghe/async-validator).
add a new force member.
And add `force` and `scroll`. `scroll` is the same as [dom-scroll-into-view's function parameter `config`](https://github.com/yiminghe/dom-scroll-into-view#function-parameter).

#### options.force: Boolean

Expand Down
2 changes: 1 addition & 1 deletion examples/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Form extends Component {
onSubmit = (e) => {
console.log('submit');
e.preventDefault();
this.props.form.validateFieldsAndScroll((error, values) => {
this.props.form.validateFieldsAndScroll({ scroll: { offsetTop: 20 } }, (error, values) => {
if (!error) {
console.log('ok', values);
} else {
Expand Down
1 change: 1 addition & 0 deletions src/createDOMForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const mixin = {
const c = options.container || getScrollableContainer(firstNode);
scrollIntoView(firstNode, c, {
onlyScrollIfNeeded: true,
...options.scroll,
});
}
}
Expand Down