Skip to content

fix(cdk/platform): tolerate composedPath errors during event replay#33390

Open
cyphercodes wants to merge 1 commit into
angular:mainfrom
cyphercodes:fix-event-target-replay-composed-path
Open

fix(cdk/platform): tolerate composedPath errors during event replay#33390
cyphercodes wants to merge 1 commit into
angular:mainfrom
cyphercodes:fix-event-target-replay-composed-path

Conversation

@cyphercodes

Copy link
Copy Markdown

Summary

Falls back to event.target when _getEventTarget cannot read event.composedPath(). Angular hydration event replay can dispatch events whose composedPath() throws, and this keeps CDK target resolution from crashing in that path while preserving the composed-path behavior for normal Shadow DOM events.

Fixes #33386.

Testing

  • pnpm install --frozen-lockfile
  • pnpm exec tsc --ignoreConfig --ignoreDeprecations 6.0 --target ES2022 --module commonjs --moduleResolution node --lib DOM,ES2022 --skipLibCheck --outDir /tmp/angular-smoke-out src/cdk/platform/features/shadow-dom.ts tmp-shadow-dom-smoke.ts
  • node /tmp/angular-smoke-out/tmp-shadow-dom-smoke.js
  • pnpm exec prettier --check src/cdk/platform/features/shadow-dom.ts
  • pnpm exec tsc --ignoreConfig --ignoreDeprecations 6.0 --noEmit --target ES2022 --module nodenext --moduleResolution nodenext --lib DOM,ES2022 --skipLibCheck src/cdk/platform/features/shadow-dom.ts tmp-shadow-dom-smoke.ts
  • git diff --check

Note: the temporary smoke file was used only for local verification and is not committed.

@pullapprove pullapprove Bot requested review from adolgachev and crisbeto June 15, 2026 03:33
@cyphercodes cyphercodes changed the title fix(cdk): tolerate composedPath errors during event replay fix(cdk/platform): tolerate composedPath errors during event replay Jun 15, 2026
@cyphercodes cyphercodes force-pushed the fix-event-target-replay-composed-path branch from 32cf11c to 0684c29 Compare June 15, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(material/select): click during hydration event replay throws "composedPath called during event replay"

1 participant