Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: preactjs/preact
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10.20.0
Choose a base ref
...
head repository: preactjs/preact
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 10.20.1
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Mar 21, 2024

  1. fix focus in and out (#4316)

    JoviDeCroock authored Mar 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a59a78c View commit details

Commits on Mar 23, 2024

  1. 10.20.1 (#4319)

    JoviDeCroock authored Mar 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    bc7c551 View commit details
Showing with 18 additions and 5 deletions.
  1. +1 −1 devtools/src/devtools.js
  2. +2 −2 package-lock.json
  3. +1 −1 package.json
  4. +6 −1 src/diff/props.js
  5. +8 −0 test/browser/events.test.js
2 changes: 1 addition & 1 deletion devtools/src/devtools.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { options, Fragment, Component } from 'preact';

export function initDevTools() {
if (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {
window.__PREACT_DEVTOOLS__.attachPreact('10.20.0', options, {
window.__PREACT_DEVTOOLS__.attachPreact('10.20.1', options, {
Fragment,
Component
});
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "preact",
"amdName": "preact",
"version": "10.20.0",
"version": "10.20.1",
"private": false,
"description": "Fast 3kb React-compatible Virtual DOM library.",
"main": "dist/preact.js",
7 changes: 6 additions & 1 deletion src/diff/props.js
Original file line number Diff line number Diff line change
@@ -55,7 +55,12 @@ export function setProperty(dom, name, value, oldValue, isSvg) {
name !== (name = name.replace(/(PointerCapture)$|Capture$/i, '$1'));

// Infer correct casing for DOM built-in events:
if (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);
if (
name.toLowerCase() in dom ||
name === 'onFocusOut' ||
name === 'onFocusIn'
)
name = name.toLowerCase().slice(2);
else name = name.slice(2);

if (!dom._listeners) dom._listeners = {};
8 changes: 8 additions & 0 deletions test/browser/events.test.js
Original file line number Diff line number Diff line change
@@ -227,4 +227,12 @@ describe('event handling', () => {
.to.have.been.calledTwice.and.to.have.been.calledWith('gotpointercapture')
.and.calledWith('lostpointercapture');
});

it('should support camel-case focus event names', () => {
render(<div onFocusIn={() => {}} onFocusOut={() => {}} />, scratch);

expect(proto.addEventListener)
.to.have.been.calledTwice.and.to.have.been.calledWith('focusin')
.and.calledWith('focusout');
});
});