Skip to content

Scheduler - Add safety guards for Angular SSR and Draggable disposal#33425

Open
aleksei-semikozov wants to merge 1 commit intoDevExpress:26_1from
aleksei-semikozov:scheduler-renderer-safety-guards-26_1
Open

Scheduler - Add safety guards for Angular SSR and Draggable disposal#33425
aleksei-semikozov wants to merge 1 commit intoDevExpress:26_1from
aleksei-semikozov:scheduler-renderer-safety-guards-26_1

Conversation

@aleksei-semikozov
Copy link
Copy Markdown
Contributor

No description provided.

@aleksei-semikozov aleksei-semikozov self-assigned this Apr 27, 2026
@aleksei-semikozov aleksei-semikozov marked this pull request as ready for review April 28, 2026 12:13
@aleksei-semikozov aleksei-semikozov requested a review from a team as a code owner April 28, 2026 12:13
Copilot AI review requested due to automatic review settings April 28, 2026 12:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds defensive guards to prevent runtime errors during Angular server-side rendering (SSR) and during Draggable teardown, improving robustness in non-standard lifecycle/SSR scenarios.

Changes:

  • Guard Draggable’s _stopAnimator() to avoid calling stop() on an uninitialized animator.
  • Add a null-check in Angular SSR rendering to avoid accessing properties on a missing rendered root element.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/devextreme/js/__internal/m_draggable.ts Makes animator stopping tolerant to cases where _scrollAnimator is not available.
packages/devextreme-angular/src/server/render.ts Adds a guard for SSR rendering when renderToString yields no root node.

temp.innerHTML = renderToString(el);

const mainElement = temp.childNodes[0];
if (!mainElement) {
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When renderToString(el) returns an empty string, this early return leaves container.innerHTML unchanged (potentially stale from a previous render). Consider clearing container.innerHTML (and returning) in this branch to align with renderIntoContainer's jsx === null handling and ensure consistent SSR output.

Suggested change
if (!mainElement) {
if (!mainElement) {
container.innerHTML = '';

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants