Merge pull request #6850 from SimonBrandner/fix/resizer

Fix resizers not letting go
pull/21833/head
David Baker 2021-09-22 08:47:27 +01:00 committed by GitHub
commit f0bf39a09a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -130,7 +130,7 @@ export default class Resizer<C extends IConfig = IConfig> {
// mark as currently resizing // mark as currently resizing
if (this.classNames.resizing) { if (this.classNames.resizing) {
this.container.classList.add(this.classNames.resizing); this.container?.classList?.add(this.classNames.resizing);
} }
if (this.config.onResizeStart) { if (this.config.onResizeStart) {
this.config.onResizeStart(); this.config.onResizeStart();
@ -147,7 +147,7 @@ export default class Resizer<C extends IConfig = IConfig> {
const body = document.body; const body = document.body;
const finishResize = () => { const finishResize = () => {
if (this.classNames.resizing) { if (this.classNames.resizing) {
this.container.classList.remove(this.classNames.resizing); this.container?.classList?.remove(this.classNames.resizing);
} }
distributor.finish(); distributor.finish();
if (this.config.onResizeStop) { if (this.config.onResizeStop) {
@ -194,7 +194,7 @@ export default class Resizer<C extends IConfig = IConfig> {
if (this?.config?.handler) { if (this?.config?.handler) {
return [this.config.handler]; return [this.config.handler];
} }
if (!this.container.children) return []; if (!this.container?.children) return [];
return Array.from(this.container.querySelectorAll(`.${this.classNames.handle}`)) as HTMLElement[]; return Array.from(this.container.querySelectorAll(`.${this.classNames.handle}`)) as HTMLElement[];
} }
} }