Add feature to ResizeNotifier to maintain isResizing state and use it to skip onScroll handling

This commit is contained in:
Michael Telatynski 2020-09-02 12:00:35 +01:00
parent 6178b3c0e2
commit cffe902504
9 changed files with 51 additions and 13 deletions

View file

@ -105,6 +105,9 @@ export default class Resizer {
if (this.classNames.resizing) {
this.container.classList.add(this.classNames.resizing);
}
if (this.config.onResizeStart) {
this.config.onResizeStart();
}
const {sizer, distributor} = this._createSizerAndDistributor(resizeHandle);
distributor.start();
@ -119,6 +122,9 @@ export default class Resizer {
if (this.classNames.resizing) {
this.container.classList.remove(this.classNames.resizing);
}
if (this.config.onResizeStop) {
this.config.onResizeStop();
}
distributor.finish();
body.removeEventListener("mouseup", finishResize, false);
document.removeEventListener("mouseleave", finishResize, false);