add scrollIntoView command
This commit is contained in:
15
packages/core/src/commands/scrollIntoView.ts
Normal file
15
packages/core/src/commands/scrollIntoView.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user