mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-24 01:17:50 +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,
|
||
|
}
|
||
|
}
|