Skip to content

Commit

Permalink
Fix dxTemplate for svg elements (T887459) (#1073) (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovchinnikov authored May 20, 2020
1 parent 038d976 commit 22b6390
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
bower_components
coverage
Expand Down
3 changes: 2 additions & 1 deletion src/core/nested-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getElement } from './utils';

import render from 'devextreme/core/renderer';
import * as events from 'devextreme/events';
import * as domAdapter from 'devextreme/core/dom_adapter';

const VISIBILITY_CHANGE_SELECTOR = 'dx-visibility-change-handler';

Expand Down Expand Up @@ -217,7 +218,7 @@ export function extractTemplate(option: IOptionWithTemplate, element: ElementRef
render: (renderData) => {
let result = element.nativeElement;

renderer.addClass(result, DX_TEMPLATE_WRAPPER_CLASS);
domAdapter.setClass(result, DX_TEMPLATE_WRAPPER_CLASS, true);

if (renderData.container) {
let container = getElement(renderData.container);
Expand Down
3 changes: 2 additions & 1 deletion src/core/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { DxTemplateHost } from './template-host';
import { getElement } from './utils';
import * as events from 'devextreme/events';
import * as domAdapter from 'devextreme/core/dom_adapter';

export const DX_TEMPLATE_WRAPPER_CLASS = 'dx-template-wrapper';

Expand Down Expand Up @@ -73,7 +74,7 @@ export class DxTemplateDirective {

childView.rootNodes.forEach((element) => {
if (element.nodeType === 1) {
this.renderer.addClass(element, DX_TEMPLATE_WRAPPER_CLASS);
domAdapter.setClass(element, DX_TEMPLATE_WRAPPER_CLASS, true);
}

events.one(element, 'dxremove', ({}, params) => {
Expand Down

0 comments on commit 22b6390

Please # to comment.