From d14a03b76120e2b45bc668d8b4bf5de0e9ccefaa Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Tue, 14 Mar 2017 01:06:09 +0200 Subject: [PATCH 1/3] Added ionLeave output event to be emitted on leave --- src/components/range/range.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 3a9cd5b68f4..36127c82524 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -307,6 +307,10 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O */ @Output() ionChange: EventEmitter = new EventEmitter(); + /** + * @output {Range} Emitted when the range selector is being left (pointer up). + */ + @Output() ionLeave: EventEmitter = new EventEmitter(); constructor( private _form: Form, @@ -411,6 +415,9 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O // trigger a haptic end this._haptic.gestureSelectionEnd(); + + // trigger ionLeave event + this.ionLeave.emit(this); } } From 24a17ff1603947b3852836b5eb237a7278e7fe8c Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Tue, 14 Mar 2017 01:55:23 +0200 Subject: [PATCH 2/3] Changed `ionLeave` to `ionDragEnd` --- src/components/range/range.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 36127c82524..132a55505ff 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -308,9 +308,9 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O @Output() ionChange: EventEmitter = new EventEmitter(); /** - * @output {Range} Emitted when the range selector is being left (pointer up). + * @output {Range} Emitted when the range selector drag ends. */ - @Output() ionLeave: EventEmitter = new EventEmitter(); + @Output() ionDragEnd: EventEmitter = new EventEmitter(); constructor( private _form: Form, @@ -416,8 +416,8 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O // trigger a haptic end this._haptic.gestureSelectionEnd(); - // trigger ionLeave event - this.ionLeave.emit(this); + // trigger ionDragEnd event + this.ionDragEnd.emit(this); } } From d0446477d1eed0c70240ed234f7c41593bdcf444 Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Wed, 15 Mar 2017 17:04:05 +0200 Subject: [PATCH 3/3] Changed ionDragEnd to ionBlur. Added ionFocus --- src/components/range/range.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 132a55505ff..bc8ad963bdd 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -302,6 +302,11 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O return null; } + /** + * @output {Range} Emitted when the range selector drag starts. + */ + @Output() ionFocus: EventEmitter = new EventEmitter(); + /** * @output {Range} Emitted when the range value changes. */ @@ -310,7 +315,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O /** * @output {Range} Emitted when the range selector drag ends. */ - @Output() ionDragEnd: EventEmitter = new EventEmitter(); + @Output() ionBlur: EventEmitter = new EventEmitter(); constructor( private _form: Form, @@ -360,6 +365,9 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O return false; } + // trigger ionFocus event + this.ionFocus.emit(this); + // prevent default so scrolling does not happen ev.preventDefault(); ev.stopPropagation(); @@ -416,8 +424,8 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O // trigger a haptic end this._haptic.gestureSelectionEnd(); - // trigger ionDragEnd event - this.ionDragEnd.emit(this); + // trigger ionBlur event + this.ionBlur.emit(this); } }