diff --git a/core/quill.ts b/core/quill.ts index 0eb4d7ac66..b7165bedbd 100644 --- a/core/quill.ts +++ b/core/quill.ts @@ -16,7 +16,7 @@ import Module from './module'; import Selection, { Range } from './selection'; import Composition from './composition'; import Theme, { ThemeConstructor } from './theme'; -import scrollRectIntoView from './utils/scrollRectIntoView'; +import scrollRectIntoView, { Rect } from './utils/scrollRectIntoView'; const debug = logger('quill'); @@ -614,6 +614,10 @@ class Quill { ); } + scrollRectIntoView(rect: Rect) { + scrollRectIntoView(this.root, rect); + } + /** * @deprecated Use Quill#scrollSelectionIntoView() instead. */ @@ -632,7 +636,7 @@ class Quill { const range = this.selection.lastRange; const bounds = range && this.selection.getBounds(range.index, range.length); if (bounds) { - scrollRectIntoView(this.root, bounds); + this.scrollRectIntoView(bounds); } }