Skip to content

Commit 678d871

Browse files
committed
fix(elements): Apply locale only to grid for now.
1 parent 8de9b20 commit 678d871

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

projects/igniteui-angular-elements/src/app/custom-strategy.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,15 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
525525
//#endregion
526526

527527
protected initializeLocale(componentRef: ComponentRef<any>) {
528+
const componentTag = this.element.tagName.toLowerCase();
529+
if (componentTag !== 'igc-grid' && componentTag !== 'igc-tree-grid' &&
530+
componentTag !== 'igc-pivot-grid' && componentTag !== 'igc-hierarchical-grid') {
531+
// For now only main grid elements?
532+
return;
533+
}
528534
const localeStringsInput = this._componentFactory.inputs.find(input => input.propName === "resourceStrings");
529535
if (localeStringsInput) {
530-
const closestElement = componentRef.location.nativeElement.closest('[lang]') as HTMLElement;
536+
const closestElement = this.element.closest('[lang]') as HTMLElement;
531537
if (closestElement) {
532538
// Do not assign anything if no tag found. By default all grids have assigned EN resource strings.
533539
const lang = closestElement.lang.toUpperCase();

0 commit comments

Comments
 (0)