final-form / final-form/final-form-focus
Provide custom focus implementation
Open
- Dominant language
- TypeScript
- Stars
- 81
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
### **feature request**
It would be nice to specify focus implementation. For example to make smooth scroll to element + Npx above it before focusing:
```js
import createDecorator from 'final-form-focus'
const onFocus = input => {
const { top } = getOffset(input);
const scrollTop = top - 50;
window.scrollTo({
top: scrollTop,
behavior: 'smooth',
});
input.focus();
}
const focusOnErrors = createDecorator(null, null, onFocus)
```
Contributor guide
Assessment
This issue has not been assessed yet.