Skip to content

Commit fe1c564

Browse files
committed
feat(adv-filtering): register svg icons #5496
1 parent 1649cac commit fe1c564

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

projects/igniteui-angular/src/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,8 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
786786
this.overlayService = overlayService;
787787
this.overlayComponentId = overlayComponentId;
788788

789+
this.filteringService.registerSVGIcons();
790+
789791
// Set pointer-events to none of the overlay content element which blocks the grid interaction after dragging
790792
this.overlayService.onOpened.pipe(first()).subscribe(() => {
791793
if (this.element.nativeElement.parentElement) {

projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class IgxFilteringService implements OnDestroy {
3939
private columnToExpressionsMap = new Map<string, ExpressionUI[]>();
4040
private _datePipe: IgxDatePipeComponent;
4141
private columnStartIndex = -1;
42+
private _filterIconsRegistered = false;
4243

4344
public gridId: string;
4445
public isFilterRowVisible = false;
@@ -211,10 +212,13 @@ export class IgxFilteringService implements OnDestroy {
211212
* Register filtering SVG icons in the icon service.
212213
*/
213214
public registerSVGIcons(): void {
214-
for (const icon of icons) {
215-
if (!this.iconService.isSvgIconCached(icon.name, FILTERING_ICONS_FONT_SET)) {
216-
this.iconService.addSvgIconFromText(icon.name, icon.value, FILTERING_ICONS_FONT_SET);
215+
if (!this._filterIconsRegistered) {
216+
for (const icon of icons) {
217+
if (!this.iconService.isSvgIconCached(icon.name, FILTERING_ICONS_FONT_SET)) {
218+
this.iconService.addSvgIconFromText(icon.name, icon.value, FILTERING_ICONS_FONT_SET);
219+
}
217220
}
221+
this._filterIconsRegistered = true;
218222
}
219223
}
220224

0 commit comments

Comments
 (0)