Skip to content

Commit 6b34fc0

Browse files
didimmovasimeonoff
andauthored
fix(date-picker): fix discrepencies in datepicker (#17282)
Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com>
1 parent 6b23e30 commit 6b34fc0

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

projects/igniteui-angular/core/src/core/styles/components/date-picker/_date-picker-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
display: flex;
6060
align-items: center;
6161
justify-content: flex-end;
62-
padding: pad(rem(8px));
62+
gap: rem(8px);
6363
}
6464

6565
%date-picker__actions {

projects/igniteui-angular/date-picker/src/date-picker/calendar-container/calendar-container.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@if (cancelButtonLabel) {
55
<button
66
#cancelButton type="button"
7-
igxButton="flat" igxRipple
7+
[igxButton]="cancelButtonType" igxRipple
88
(click)="calendarCancel.emit({ owner: this})"
99
>
1010
{{ cancelButtonLabel }}
@@ -14,7 +14,7 @@
1414
<button
1515
#closeButton
1616
type="button"
17-
igxButton="flat"
17+
[igxButton]="closeButtonType"
1818
igxRipple
1919
(click)="calendarClose.emit({ owner: this})"
2020
>

projects/igniteui-angular/date-picker/src/date-picker/calendar-container/calendar-container.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
HostListener,
77
HostBinding
88
} from '@angular/core';
9-
import { IgxButtonDirective, IgxRippleDirective } from 'igniteui-angular/directives';
9+
import { IgxButtonDirective, IgxButtonType, IgxRippleDirective } from 'igniteui-angular/directives';
1010
import { IgxCalendarComponent } from 'igniteui-angular/calendar';
1111
import { IgxDividerDirective } from 'igniteui-angular/directives';
1212
import { IBaseEventArgs, DateRange, CustomDateRange, PickerInteractionMode, IDateRangePickerResourceStrings, IgxPickerActionsDirective } from 'igniteui-angular/core';
@@ -56,7 +56,9 @@ export class IgxCalendarContainerComponent {
5656
public resourceStrings!: IDateRangePickerResourceStrings;
5757
public vertical = false;
5858
public closeButtonLabel: string;
59+
public closeButtonType: IgxButtonType = 'flat';
5960
public cancelButtonLabel: string;
61+
public cancelButtonType: IgxButtonType = 'flat';
6062
public todayButtonLabel: string;
6163
public mode: PickerInteractionMode = PickerInteractionMode.DropDown;
6264
public pickerActions: IgxPickerActionsDirective;

projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ import {
3737
DateTimeUtil,
3838
IgxPickerActionsDirective,
3939
isDateInRanges,
40-
PickerCalendarOrientation
40+
PickerCalendarOrientation,
41+
THEME_TOKEN,
42+
ThemeToken
4143
} from 'igniteui-angular/core';
4244
import { IgxCalendarContainerComponent } from '../date-picker/calendar-container/calendar-container.component';
4345
import { PickerBaseDirective } from '../date-picker/picker-base.directive';
@@ -107,6 +109,7 @@ const SingleInputDatesConcatenationString = ' - ';
107109
export class IgxDateRangePickerComponent extends PickerBaseDirective
108110
implements OnChanges, OnInit, AfterViewInit, OnDestroy, ControlValueAccessor, Validator {
109111
protected platform = inject(PlatformUtil);
112+
private themeToken = inject<ThemeToken>(THEME_TOKEN);
110113
private _injector = inject(Injector);
111114
private _cdr = inject(ChangeDetectorRef);
112115
private _overlayService = inject<IgxOverlayService>(IgxOverlayService);
@@ -1337,6 +1340,10 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
13371340
componentInstance.mode = this.mode;
13381341
componentInstance.closeButtonLabel = !this.isDropdown ? this.doneButtonText : null;
13391342
componentInstance.cancelButtonLabel = !this.isDropdown ? this.cancelButtonText : null;
1343+
if (!this.isDropdown && this.themeToken.theme === 'indigo') {
1344+
componentInstance.closeButtonType = 'contained';
1345+
componentInstance.cancelButtonType = 'outlined';
1346+
}
13401347
componentInstance.pickerActions = this.pickerActions;
13411348
componentInstance.usePredefinedRanges = this.usePredefinedRanges;
13421349
componentInstance.customRanges = this.customRanges;

0 commit comments

Comments
 (0)