From 6fe028969e29c60aab36b95316a6c0c9080bae2e Mon Sep 17 00:00:00 2001 From: Svetla Boykova Date: Wed, 27 Feb 2019 13:48:31 +0200 Subject: [PATCH] fix(date-picker): Fixed spinning only when the editor is focused #3034 (#4027) * fix(date-picker): Fixed spinning only when the editor is focused #3034 * fix(date-picker): Hidden internal event #4027 * fix(date-picker): Added missing disabled prop for editable date picker #4027 --- .../src/lib/date-picker/date-picker.component.html | 2 +- .../src/lib/date-picker/date-picker.component.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.html b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.html index d5408de90a2..cf2fe31e147 100644 --- a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.html +++ b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.html @@ -16,7 +16,7 @@ diff --git a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts index d6f1e612123..2c7f62ae5aa 100644 --- a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts +++ b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts @@ -707,6 +707,9 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor private _modalOverlaySettings: OverlaySettings; private _transformedDate; + /** + * @hidden + */ @HostListener('keydown.spacebar', ['$event']) @HostListener('keydown.space', ['$event']) public onSpaceClick(event: KeyboardEvent) { @@ -1008,11 +1011,12 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor * @hidden */ public onWheel(event) { - event.preventDefault(); - event.stopPropagation(); - const sign = (event.deltaY > 0) ? -1 : 1; - this.spinValue(event.target.value, sign, event.type); - + if (this._isInEditMode) { + event.preventDefault(); + event.stopPropagation(); + const sign = (event.deltaY > 0) ? -1 : 1; + this.spinValue(event.target.value, sign, event.type); + } } /**