add scrollIntoView command

This commit is contained in:
Philipp Kühn
2020-09-24 22:21:44 +02:00
parent 57bafb00b9
commit 9df4cd4e35
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { Command } from '../Editor'
type ScrollIntoViewCommand = () => Command
declare module '../Editor' {
interface Commands {
scrollIntoView: ScrollIntoViewCommand,
}
}
export const scrollIntoView: ScrollIntoViewCommand = () => ({ tr }) => {
tr.scrollIntoView()
return true
}