Skip to content

Commit

Permalink
fix(datepicker): double tap ios issue (#5821)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloff200 committed Jun 23, 2020
1 parent 41e7a0b commit 955cb93
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/datepicker/themes/bs/bs-days-calendar-view.component.ts
Expand Up @@ -42,17 +42,21 @@ import { BsDatepickerConfig } from '../../bs-datepicker.config';
<tbody>
<tr *ngFor="let week of calendar.weeks; let i = index">
<td class="week" [class.active-week]="isWeekHovered" *ngIf="options.showWeekNumbers">
<span
<span *ngIf="isiOS" (click)="selectWeek(week)">{{ calendar.weekNumbers[i] }}</span>
<span *ngIf="!isiOS"
(click)="selectWeek(week)"
(mouseenter)="weekHoverHandler(week, true)"
(mouseleave)="weekHoverHandler(week, false)">{{ calendar.weekNumbers[i] }}</span>
</td>
<td *ngFor="let day of week.days" role="gridcell">
<span bsDatepickerDayDecorator
<span *ngIf="!isiOS" bsDatepickerDayDecorator
[day]="day"
(click)="selectDay(day)"
(mouseenter)="hoverDay(day, true)"
(mouseleave)="hoverDay(day, false)">{{ day.label }}</span>
<span *ngIf="isiOS" bsDatepickerDayDecorator
[day]="day"
(click)="selectDay(day)">{{ day.label }}</span>
</td>
</tr>
</tbody>
Expand All @@ -73,8 +77,12 @@ export class BsDaysCalendarViewComponent {
@Output() onHoverWeek = new EventEmitter<WeekViewModel>();

isWeekHovered: boolean;
isiOS: RegExpMatchArray;

constructor(private _config: BsDatepickerConfig) { }
constructor(private _config: BsDatepickerConfig) {
const device = navigator.userAgent.toLowerCase();
this.isiOS = device.match(/(iphone|ipod|ipad|apple)/);
}

navigateTo(event: BsNavigationDirection): void {
const step = BsNavigationDirection.DOWN === event ? -1 : 1;
Expand Down

5 comments on commit 955cb93

@trigonometric-act
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we update ngx bootstrap it gets applied?

@daniloff200
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedicursandroidsayhello hey
Right now, no, we're going to release a new version, and after that, yes, you can use a new version with a fix

@trigonometric-act
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix, do you know when? I need it asap

@daniloff200
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope, it will be this week

@trigonometric-act
Copy link

@trigonometric-act trigonometric-act commented on 955cb93 Jun 28, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.