Skip to content

Conversation

@simeonoff
Copy link
Collaborator

@simeonoff simeonoff commented Oct 29, 2025

Closes #16257

@didimmova To test the validity of the fixes in this PR, build the project and test the build with Ignite UI for Angular Samples. You will need to set rendererMode to Prerender for the scheduling samples.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@simeonoff simeonoff requested a review from didimmova October 29, 2025 13:26
@didimmova didimmova added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Oct 29, 2025
@kdinev kdinev requested a review from Copilot October 30, 2025 08:12
Copy link
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 SSR (Server-Side Rendering) safety checks to calendar components by preventing DOM manipulation operations when running in a non-browser environment. The changes ensure that native element focus operations and browser-specific APIs are only called when running in a browser context.

Key changes:

  • Added PlatformUtil injection to calendar components to detect browser environment
  • Wrapped all nativeElement.focus() calls and DOM-dependent operations with platform.isBrowser checks
  • Added null-safety checks for native element references before calling .focus()
  • Changed HTML <caption> element to <div> in calendar template (semantic change)

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
years-view.component.ts Added platform detection and guarded focus call in onMouseDown
months-view.component.ts Added platform detection and guarded focus call in onMouseDown
month-picker.component.ts Added platform checks to multiple focus operations
days-view.component.ts Added platform check to focus call in mouse handler
calendar.services.ts Added early return in keyboard handler attachment for non-browser environments
calendar.component.ts Added platform checks to focus operations and click handlers
calendar.component.html Changed <caption> to <div> and refactored conditional logic to use @switch

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simeonoff simeonoff merged commit ad2af00 into master Oct 30, 2025
12 of 14 checks passed
@simeonoff simeonoff deleted the simeonoff/calendar-ssr branch October 30, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

angular: ssr 📆 calendar version: 21.0.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SSR]: Calendar component SSR Issues

3 participants