Skip to content

feat: support KeyboardEvent - #59

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
JeanMeche:fix/keyboard-event
Nov 13, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
JeanMeche:fix/keyboard-event

Conversation

@JeanMeche

Copy link
Copy Markdown
Member

Description

Following #58, domino.impl.Event points to Node's native Event constructor in Node.js 18+.

Because Node does not provide a global KeyboardEvent, @angular/platform-server previously aliased KeyboardEvent = domino.impl.Event. With domino.impl.Event being Node's native Event, constructing new KeyboardEvent(type, { key, code, ... }) silently dropped all keyboard-specific dictionary properties, which broke Angular key event tests.

Changes

  • Add KeyboardEvent implementation extending UIEvent.
  • Expose KeyboardEvent in lib/events.js and on domino.impl.
  • Add keyboardevent and keyevents to Document.js to support createEvent('KeyboardEvent').
  • Remove createEvent('KeyboardEvent') from test/web-platform-blocklist.json.
  • Add unit tests for KeyboardEvent in test/domino.js.

- Add KeyboardEvent implementation extending UIEvent.
- Expose KeyboardEvent on domino.impl and in events.js.
- Support createEvent('KeyboardEvent') and aliases in Document.js.
- Remove KeyboardEvent from web-platform-tests blocklist.
@JeanMeche

Copy link
Copy Markdown
Member Author

Note, here's the breakage angular/angular#72023

@alan-agius4
alan-agius4 merged commit 51fa184 into angular:main Nov 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants