Skip to content

Commit

Permalink
Expose scrollRectIntoView
Browse files Browse the repository at this point in the history
  • Loading branch information
luin authored and jhchen committed Aug 1, 2023
1 parent e3f2e3f commit 601e287
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/quill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -614,6 +614,10 @@ class Quill {
);
}

scrollRectIntoView(rect: Rect) {
scrollRectIntoView(this.root, rect);
}

/**
* @deprecated Use Quill#scrollSelectionIntoView() instead.
*/
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 601e287

Please sign in to comment.