diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 1a4e44020..df12db6cd 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -112,6 +112,7 @@ Change log ## 10.1.2-dev (TBD) * fix: [#2672](https://github.com/gridstack/gridstack.js/pull/2672) dropping into full grid JS error * fix: [#2676](https://github.com/gridstack/gridstack.js/issues/2676) handle minW resizing when column count is less +* fix: [#2677](https://github.com/gridstack/gridstack.js/issues/2677) allow button as handle dragging ## 10.1.2 (2024-03-30) * fix: [#2628](https://github.com/gridstack/gridstack.js/issues/2628) `removeAll()` does not trigger Angular's ngOnDestroy diff --git a/spec/e2e/html/2677_drag_button.html b/spec/e2e/html/2677_drag_button.html new file mode 100644 index 000000000..7c7c7653f --- /dev/null +++ b/spec/e2e/html/2677_drag_button.html @@ -0,0 +1,25 @@ + + + + + + + drag button demo + + + + + + +
+ + + diff --git a/src/dd-draggable.ts b/src/dd-draggable.ts index 436ffe0b2..cab50b606 100644 --- a/src/dd-draggable.ts +++ b/src/dd-draggable.ts @@ -136,7 +136,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt if (e.button !== 0) return true; // only left click // make sure we are not clicking on known object that handles mouseDown, or ones supplied by the user - if ((e.target as HTMLElement).closest(skipMouseDown)) return true; + if (e.target !== this.dragEl && (e.target as HTMLElement).closest(skipMouseDown)) return true; if (this.option.cancel) { if ((e.target as HTMLElement).closest(this.option.cancel)) return true; }