Skip to content

Commit e09fdf8

Browse files
alicewriteswrongsrwaskiewicz
authored andcommitted
fix(declarations): correct event handler names for composition events (#3777)
This updates a fewevent handler names in `src/declarations/stencil-public-runtime.ts` so that the composition events have the correct casing.
1 parent 264a624 commit e09fdf8

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

BREAKING_CHANGES.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
1919
* [Strongly Typed Inputs](#strongly-typed-inputs)
2020
* [Narrowed Typing for `autocapitalize` Attribute](#narrowed-typing-for-autocapitalize-attribute)
2121
* [Custom Types for Props and Events are now Exported from `components.d.ts`](#custom-types-for-props-and-events-are-now-exported-from-componentsdts)
22+
* [Composition Event Handlers Renamed](#composition-event-handlers-renamed)
2223
* [Output Targets](#output-targets)
2324
* [`dist-custom-elements` Output Target](#dist-custom-elements-output-target)
2425
* [Add `customElementsExportBehavior` to Control Export Behavior](#add-customelementsexportbehavior-to-control-export-behavior)
@@ -100,7 +101,7 @@ The [`autocaptialize` attribute](https://developer.mozilla.org/en-US/docs/Web/HT
100101
This change brings Stencil into closer alignment with TypeScript's typings for the attribute.
101102
No explicit changes are needed, unless a project was passing non-strings to the attribute.
102103

103-
### Custom Types for Props and Events are now Exported from `components.d.ts`
104+
#### Custom Types for Props and Events are now Exported from `components.d.ts`
104105

105106
Custom types for props and custom events are now re-exported from a project's `components.d.ts` file.
106107

@@ -161,6 +162,21 @@ Projects that manually create type definitions from `components.d.ts` will eithe
161162
- remove the manually created type (if the types generated in `components.d.ts` suffice)
162163
- update their type creation logic to account for potential naming collisions with the newly generated types
163164

165+
#### Composition Event Handlers Renamed
166+
167+
The names of Stencil's composition event handlers have been changed in order to
168+
correct a casing issue which prevented handlers from being called when events
169+
fired. The changes are as follows:
170+
171+
| previous name | new name |
172+
| ---------------------------- | ---------------------------- |
173+
| `onCompositionEnd` | `onCompositionend` |
174+
| `onCompositionEndCapture` | `onCompositionendCapture` |
175+
| `onCompositionStart` | `onCompositionstart` |
176+
| `onCompositionStartCapture` | `onCompositionstartCapture` |
177+
| `onCompositionUpdate` | `onCompositionupdate` |
178+
| `onCompositionUpdateCapture` | `onCompositionupdateCapture` |
179+
164180
### Output Targets
165181

166182
#### `dist-custom-elements` Output Target

src/declarations/stencil-public-runtime.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1669,12 +1669,12 @@ export namespace JSXBase {
16691669
onPasteCapture?: (event: ClipboardEvent) => void;
16701670

16711671
// Composition Events
1672-
onCompositionEnd?: (event: CompositionEvent) => void;
1673-
onCompositionEndCapture?: (event: CompositionEvent) => void;
1674-
onCompositionStart?: (event: CompositionEvent) => void;
1675-
onCompositionStartCapture?: (event: CompositionEvent) => void;
1676-
onCompositionUpdate?: (event: CompositionEvent) => void;
1677-
onCompositionUpdateCapture?: (event: CompositionEvent) => void;
1672+
onCompositionend?: (event: CompositionEvent) => void;
1673+
onCompositionendCapture?: (event: CompositionEvent) => void;
1674+
onCompositionstart?: (event: CompositionEvent) => void;
1675+
onCompositionstartCapture?: (event: CompositionEvent) => void;
1676+
onCompositionupdate?: (event: CompositionEvent) => void;
1677+
onCompositionupdateCapture?: (event: CompositionEvent) => void;
16781678

16791679
// Focus Events
16801680
onFocus?: (event: FocusEvent) => void;

0 commit comments

Comments
 (0)