Skip to content

v2.2.15 - Native Shadow DOM & Event Retargeting Support

Choose a tag to compare

@toozuuu toozuuu released this 19 May 14:01
· 41 commits to main since this release

We are excited to announce the release of v2.2.15 of ngxsmk-datepicker! 馃殌

This release introduces native support for Shadow DOM encapsulation (such as Angular Custom Elements, Web Components, or Ionic shadow boundaries), resolving issues with premature calendar and dropdown closures due to browser event retargeting.


馃殌 What's New

馃З Native Shadow DOM Support & Event Retargeting (fixes #268)

  • Under the Hood: Consuming the datepicker inside Shadow DOM previously caused popover calendars and custom select elements to close prematurely because standard .contains() checks fail on retargeted bubble events.
  • The Solution: Upgraded NgxsmkDatepickerComponent.containsNode() and CustomSelectComponent.onDocumentTouchStart() to scan event.composedPath() when available, correctly tracking event boundaries across Shadow Roots while maintaining solid light DOM fallbacks.
  • Ultra-Clean Architecture: Decomposed the path checks into private helper methods (containsNodeViaComposedPath, containsNodeViaDOM) to achieve a perfect cognitive complexity score of 2 and guarantee maximum readability.

馃И Solid Tests & Quality Assurance

  • Shadow DOM Specs: Added a dedicated test suite (shadow-dom-compatibility.spec.ts) mock-testing event retargeting scenarios across virtual shadow roots.
  • 100% Green Build: All 1,232 unit tests pass perfectly!
  • Type Safety Audit: Cleaned up dozens of redundant typescript type assertions (e.g. as EventListenerOptions, as HTMLElement) to align with strict Angular compilation targets and remove compiler warnings.

馃摉 Documentation & Demo App Upgrades

  • Full Documentation Overhaul: Synchronized the metadata header (**Last updated:** May 19, 2026 - **Current stable:** v2.2.15) across all 31 markdown (.md) files in the project, removing all outdated legacy version references.
  • Demo App Synchronized: Updated version badges across all 8 supported languages (English, German, Spanish, Swedish, Korean, Chinese, Japanese, French), updated CLI installation instructions, and synced index.html SEO schema to 2.2.15.
  • Example App Alignment: Updated examples/ionic-test-app to target ^2.2.15.

馃摝 Installation

To upgrade your project to the latest version:

# Using npm
npm install ngxsmk-datepicker@2.2.15

# Using Yarn
yarn add ngxsmk-datepicker@2.2.15

# Using pnpm
pnpm add ngxsmk-datepicker@2.2.15

# Using Bun
bun add ngxsmk-datepicker@2.2.15