Skip to content

fix(types): add missing global attributes and event handlers - #7046

Merged
johnjenkins merged 4 commits into
stenciljs:mainfrom
marcomattes:fix/jsx-global-attr-types
Nov 27, 2026
Merged

johnjenkins merged 4 commits into
stenciljs:mainfrom
marcomattes:fix/jsx-global-attr-types

Conversation

@marcomattes

@marcomattes marcomattes commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What is the current behavior?

Several standard global attributes and event handlers are missing from the JSXBase types, so using them in TSX is a type error (e.g. onBeforeInput, onCommand, onScrollEnd, writingSuggestions, anchor).

GitHub Issue Number: N/A

What is the new behavior?

Adds the missing types to src/declarations/stencil-public-runtime.ts:

  • Global attributes: virtualKeyboardPolicy, writingSuggestions (plus lowercase variants), anchor, containertiming, containertimingignore, headingoffset, headingreset
  • Events (with Capture variants): onBeforeMatch, onContentVisibilityAutoStateChange, onCommand (new CommandEvent interface), onBeforeInput, onFormData, onSelectionChange, onSelectStart, onFullscreenchange / onFullscreenerror, onSecurityPolicyViolation, onPointerRawUpdate, onScrollEnd, onScrollSnapChange, onScrollSnapChanging, onAnimationCancel
  • Element-specific: onContextLost / onContextRestored on <canvas>, onCueChange on <track>

The fullscreen handlers stay lowercase (onFullscreenchange) because onfullscreenchange is not on window, so the runtime keeps the case as written.

Documentation

N/A

Does this introduce a breaking change?

  • Yes
  • No

Testing

Type-only, additive change (new optional members and one new interface). Verify with npm run build.

Other information

N/A

@marcomattes
marcomattes requested a review from a team as a code owner November 26, 2026 08:51
@johnjenkins

Copy link
Copy Markdown
Contributor

Hey @marcomattes thanks for this but non v5-specific fixes like this should go into main / v4 still atm and come into v5 downstream 🙏

@marcomattes
marcomattes changed the base branch from v5 to main November 26, 2026 12:24
@marcomattes
marcomattes force-pushed the fix/jsx-global-attr-types branch from 2ec19e1 to afa0890 Compare November 26, 2026 12:24
@marcomattes

Copy link
Copy Markdown
Contributor Author

Thanks @johnjenkins, makes sense! I've retargeted this to main and rebased the change onto v4.

@johnjenkins johnjenkins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

few little bits :)

johnjenkins and others added 2 commits November 26, 2026 23:55
- add Capture variants for canvas and track events
- type onContentVisibilityAutoStateChange with ContentVisibilityAutoStateChangeEvent
- drop unshipped `anchor` attribute

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@johnjenkins
johnjenkins enabled auto-merge (squash) November 26, 2026 23:56
@johnjenkins
johnjenkins merged commit bfca447 into stenciljs:main Nov 27, 2026
31 checks passed
johnjenkins added a commit that referenced this pull request Nov 27, 2026
* fix(types): add missing global attributes and event handlers

* fix(types): address review feedback on JSX attribute types

- add Capture variants for canvas and track events
- type onContentVisibilityAutoStateChange with ContentVisibilityAutoStateChangeEvent
- drop unshipped `anchor` attribute

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: John Jenkins <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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