Skip to content

Commit

Permalink
Fix T1247485 - Scheduler - "Cannot read properties of null (reading '…
Browse files Browse the repository at this point in the history
…nextSibling')" error occurs if dateCellTemplate has more than one root element

+ WIP
  • Loading branch information
GoodDayForSurf committed Sep 16, 2024
1 parent dab8878 commit 9880ec1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/devextreme-vue/src/core/templates-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,25 @@ class TemplatesManager {

const element = mountedTemplate.$el as HTMLElement;
container.removeChild(placeholder);

let hasOnlyText = true;

while (placeholder.firstChild) {
hasOnlyText = hasOnlyText && placeholder.firstChild.nodeType !== 1;
container.appendChild(placeholder.firstChild);
}

domAdapter.setClass(element, DX_TEMPLATE_WRAPPER_CLASS, true);

if (element.nodeType === Node.TEXT_NODE) {
if (hasOnlyText) {
const removalListener = document.createElement(container.nodeName === 'TABLE' ? 'tbody' : 'span');
removalListener.style.display = 'none';
/* container.appendChild(removalListener);
container.appendChild(removalListener);
one(
removalListener,
DX_REMOVE_EVENT,
mountedTemplate.$.appContext.app.unmount.bind(mountedTemplate),
);*/
);
} else {
one(
element,
Expand Down

0 comments on commit 9880ec1

Please sign in to comment.