Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Remove autoscroll on form validator
Browse files Browse the repository at this point in the history
  • Loading branch information
jayrbolton committed Feb 8, 2017
1 parent 6d95ea5 commit 589cd03
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
5 changes: 0 additions & 5 deletions validated-form/index.es6
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,9 @@ const field = R.curryN(4, (state, sel, data={}, children=[]) => {
'data-ff-field': invalid ? 'invalid' : 'valid'
, 'data-ff-field-error': err ? err : ''
}
, hook: {insert: scrollToThis}
}, [elm])
})

const scrollToThis = vnode => {
vnode.elm.scrollIntoView({block: 'start', behavior: 'smooth'})
}


// Pass in an array of validation functions and the event object
// Will return a pair of [name, errorMsg] (errorMsg will be null if no errors present)
Expand Down
7 changes: 1 addition & 6 deletions validated-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,10 @@ var field = R.curryN(4, function (state, sel) {
attrs: {
'data-ff-field': invalid ? 'invalid' : 'valid',
'data-ff-field-error': err ? err : ''
},
hook: { insert: scrollToThis }
}
}, [elm]);
});

var scrollToThis = function scrollToThis(vnode) {
vnode.elm.scrollIntoView({ block: 'start', behavior: 'smooth' });
};

// Pass in an array of validation functions and the event object
// Will return a pair of [name, errorMsg] (errorMsg will be null if no errors present)
var validateField = R.curry(function (state, node) {
Expand Down

0 comments on commit 589cd03

Please sign in to comment.