From 773b147a0312a7a7cf9cc100fc0ee20c847b0429 Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Tue, 2 Nov 2021 12:48:50 +0100 Subject: [PATCH] Add a condition to only activate the resizer which belongs to the clicked handle (#7055) --- src/resizer/resizer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/resizer/resizer.ts b/src/resizer/resizer.ts index b090214312..f9e762aeaa 100644 --- a/src/resizer/resizer.ts +++ b/src/resizer/resizer.ts @@ -122,9 +122,14 @@ export default class Resizer { // child dom nodes that can be the target const resizeHandle = event.target && (event.target).closest(`.${this.classNames.handle}`); const hasHandler = this?.config?.handler; - if (!resizeHandle || (!hasHandler && resizeHandle.parentElement !== this.container)) { + // prevent that stacked resizer's are both activated with one mouse event + // (this is possible because the mouse events are connected to the containers not the handles) + if (!resizeHandle || // if no resizeHandle exist / mouse event hit the container not the handle + (!hasHandler && resizeHandle.parentElement !== this.container) || // no handler from config -> check if the containers match + (hasHandler && resizeHandle !== hasHandler)) { // handler from config -> check if the handlers match return; } + // prevent starting a drag operation event.preventDefault();