From 601e287063a7448a502936d0d4e13e1351394500 Mon Sep 17 00:00:00 2001 From: Zihua Li Date: Tue, 1 Aug 2023 13:45:56 +0800 Subject: [PATCH] Expose scrollRectIntoView --- core/quill.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); } }