Skip to content

Commit cf0d401

Browse files
authored
Merge branch 'master' into fix-effect-ordering
2 parents 77d6ae4 + 98fb678 commit cf0d401

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

compat/src/render.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ options.vnode = vnode => {
123123
if (IS_DOM && i === 'children' && type === 'noscript') {
124124
// Emulate React's behavior of not rendering the contents of noscript tags on the client.
125125
continue;
126-
}
127-
else if (i === 'value' && 'defaultValue' in props && value == null) {
126+
} else if (i === 'value' && 'defaultValue' in props && value == null) {
128127
// Skip applying value if it is null/undefined and we already set
129128
// a default value
130129
continue;
@@ -154,7 +153,7 @@ options.vnode = vnode => {
154153
i = 'onfocusin';
155154
} else if (/^onblur$/i.test(i)) {
156155
i = 'onfocusout';
157-
} else if (/^on(Ani|Tra|Tou|BeforeInp)/.test(i)) {
156+
} else if (/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)) {
158157
i = i.toLowerCase();
159158
} else if (nonCustomElement && CAMEL_PROPS.test(i)) {
160159
i = i.replace(/[A-Z0-9]/, '-$&').toLowerCase();

compat/test/browser/events.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,4 +275,11 @@ describe('preact/compat events', () => {
275275
scratch.firstChild.dispatchEvent(createEvent('beforeinput'));
276276
expect(spy).to.be.calledOnce;
277277
});
278+
279+
it('should normalize compositionstart event listener', () => {
280+
let spy = sinon.spy();
281+
render(<input onCompositionStart={spy} />, scratch);
282+
scratch.firstChild.dispatchEvent(createEvent('compositionstart'));
283+
expect(spy).to.be.calledOnce;
284+
});
278285
});

src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export function cloneElement<P>(
248248
// -----------------------------------
249249

250250
// TODO: Revisit what the public type of this is...
251-
export const Fragment: ComponentClass<{}, {}>;
251+
export const Fragment: FunctionComponent<{}>;
252252

253253
//
254254
// Preact options

0 commit comments

Comments
 (0)