mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 17:07:49 +08:00
21 lines
393 B
TypeScript
21 lines
393 B
TypeScript
|
import { Command } from '../Editor'
|
||
|
import { createExtension } from '../Extension'
|
||
|
|
||
|
export const ScrollIntoView = createExtension({
|
||
|
addCommands() {
|
||
|
return {
|
||
|
scrollIntoView: (): Command => ({ tr }) => {
|
||
|
tr.scrollIntoView()
|
||
|
|
||
|
return true
|
||
|
},
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
|
||
|
declare module '../Editor' {
|
||
|
interface AllExtensions {
|
||
|
ScrollIntoView: typeof ScrollIntoView,
|
||
|
}
|
||
|
}
|