Skip to content

Commit

Permalink
feat(range): add ionFocus and ionBlur events (#10761)
Browse files Browse the repository at this point in the history
* Added ionLeave output event to be emitted on leave

* Changed `ionLeave` to `ionDragEnd`

* Changed ionDragEnd to ionBlur. Added ionFocus
  • Loading branch information
AmitMY authored and manucorporat committed Mar 15, 2017
1 parent 46fe1ff commit 8f310eb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/range/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,20 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
return null;
}

/**
* @output {Range} Emitted when the range selector drag starts.
*/
@Output() ionFocus: EventEmitter<Range> = new EventEmitter<Range>();

/**
* @output {Range} Emitted when the range value changes.
*/
@Output() ionChange: EventEmitter<Range> = new EventEmitter<Range>();

/**
* @output {Range} Emitted when the range selector drag ends.
*/
@Output() ionBlur: EventEmitter<Range> = new EventEmitter<Range>();

constructor(
private _form: Form,
Expand Down Expand Up @@ -356,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();
Expand Down Expand Up @@ -411,6 +423,9 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O

// trigger a haptic end
this._haptic.gestureSelectionEnd();

// trigger ionBlur event
this.ionBlur.emit(this);
}
}

Expand Down

0 comments on commit 8f310eb

Please sign in to comment.