Skip to content

Commit afe1663

Browse files
authored
Add timeout to dialog open animation so that it does not flicker when moving fast within images (#93)
1 parent 7119029 commit afe1663

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

projects/erp-hgrid/src/app/erp-hgrid-sample/erp-hgrid-sample.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ import {
3838
THEME_TOKEN,
3939
ThemeToken,
4040
IgxGridToolbarDirective,
41+
OverlaySettings,
4142
IgxStringFilteringOperand
4243
} from 'igniteui-angular';
44+
import { fadeIn } from 'igniteui-angular/animations'
4345
import { IgxSparklineModule } from 'igniteui-angular-charts';
4446
import { defineComponents, IgcRatingComponent } from 'igniteui-webcomponents';
4547
import { dropbox, delivery, billPaid, check } from '@igniteui/material-icons-extended';
4648
import { OrderDetails, OrderStatus, TemplateDataModel } from '../data/dataModels';
4749
import { SalesTrendsChartComponent } from '../sales-trends-chart/sales-trends-chart.component';
4850
import { ErpDataService } from '../services/erp-data.service';
51+
import { useAnimation } from '@angular/animations';
4952

5053
defineComponents(IgcRatingComponent);
5154

@@ -168,19 +171,25 @@ export class ErpHGridSampleComponent implements AfterViewInit {
168171
}
169172

170173
public onImageHover(event: MouseEvent, dialog: IgxDialogComponent) {
171-
if(dialog) {
174+
if (dialog) {
172175
const targetEl = event.target as HTMLElement;
173176

174177
const positionSettings: PositionSettings = {
178+
openAnimation: useAnimation(fadeIn, {
179+
params: {
180+
delay: '400ms'
181+
}
182+
}),
175183
horizontalStartPoint: HorizontalAlignment.Right,
176184
verticalStartPoint: VerticalAlignment.Top
177185
};
178186

179-
dialog.open({
187+
const overlaySettings: OverlaySettings = {
180188
target: targetEl,
181189
modal: false,
182190
positionStrategy: new AutoPositionStrategy(positionSettings)
183-
});
191+
}
192+
dialog.open(overlaySettings);
184193
}
185194
}
186195

0 commit comments

Comments
 (0)