From 9e3c6a048dc9aae988c2e3673b8ea6251513c791 Mon Sep 17 00:00:00 2001 From: Janne Julkunen Date: Wed, 2 Jan 2019 11:29:40 +0200 Subject: [PATCH] Added drag events propagation stopping, fixes #153 --- src/lib/color-picker.component.html | 8 ++++---- src/lib/color-picker.component.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/color-picker.component.html b/src/lib/color-picker.component.html index fd425d2..f323bd0 100644 --- a/src/lib/color-picker.component.html +++ b/src/lib/color-picker.component.html @@ -1,7 +1,7 @@
-
+
@@ -19,15 +19,15 @@
-
+
-
+
-
+
diff --git a/src/lib/color-picker.component.ts b/src/lib/color-picker.component.ts index 27f099b..1b8bff6 100644 --- a/src/lib/color-picker.component.ts +++ b/src/lib/color-picker.component.ts @@ -326,11 +326,15 @@ export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewInit { } } - public onDragEnd(slider: string): void { + public onDragEnd(event: Event, slider: string): void { + event.stopPropagation(); + this.directiveInstance.sliderDragEnd({ slider: slider, color: this.outputColor }); } - public onDragStart(slider: string): void { + public onDragStart(event: Event, slider: string): void { + event.stopPropagation(); + this.directiveInstance.sliderDragStart({ slider: slider, color: this.outputColor }); }