add scrollIntoView command
This commit is contained in:
@@ -8,6 +8,7 @@ export { liftListItem } from './liftListItem'
|
||||
export { removeMark } from './removeMark'
|
||||
export { removeMarks } from './removeMarks'
|
||||
export { replaceWithNode } from './replaceWithNode'
|
||||
export { scrollIntoView } from './scrollIntoView'
|
||||
export { selectAll } from './selectAll'
|
||||
export { selectParentNode } from './selectParentNode'
|
||||
export { setContent } from './setContent'
|
||||
|
||||
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