Skip to content

Commit 8f310eb

Browse files
AmitMYmanucorporat
authored andcommitted
feat(range): add ionFocus and ionBlur events (#10761)
* Added ionLeave output event to be emitted on leave * Changed `ionLeave` to `ionDragEnd` * Changed ionDragEnd to ionBlur. Added ionFocus
1 parent 46fe1ff commit 8f310eb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/components/range/range.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,20 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
302302
return null;
303303
}
304304

305+
/**
306+
* @output {Range} Emitted when the range selector drag starts.
307+
*/
308+
@Output() ionFocus: EventEmitter<Range> = new EventEmitter<Range>();
309+
305310
/**
306311
* @output {Range} Emitted when the range value changes.
307312
*/
308313
@Output() ionChange: EventEmitter<Range> = new EventEmitter<Range>();
309314

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

311320
constructor(
312321
private _form: Form,
@@ -356,6 +365,9 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
356365
return false;
357366
}
358367

368+
// trigger ionFocus event
369+
this.ionFocus.emit(this);
370+
359371
// prevent default so scrolling does not happen
360372
ev.preventDefault();
361373
ev.stopPropagation();
@@ -411,6 +423,9 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
411423

412424
// trigger a haptic end
413425
this._haptic.gestureSelectionEnd();
426+
427+
// trigger ionBlur event
428+
this.ionBlur.emit(this);
414429
}
415430
}
416431

0 commit comments

Comments
 (0)