Repository navigation
Version Packages - #74
Merged
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
github-actions
Bot
force-pushed
the
changeset-release/master
branch
10 times, most recently
from
November 11, 2026 00:04
a63d520 to
a5f9f80
Compare
github-actions
Bot
force-pushed
the
changeset-release/master
branch
from
November 11, 2026 01:21
a5f9f80 to
4eaaa32
Compare
…es in 1.10.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
react-spring-lightbox@1.10.0
Released 2026-11-11
Minor Changes
3a4933c: Add an ES module build and an
exportsmap, soimportandrequireeach load their own bundle with matching types.dist/index.mjs(ES module) anddist/index.cjs(CommonJS, renamed fromdist/index.cjs.js), each with a source map. The type declarations are bundled intodist/index.d.mtsforimportanddist/index.d.ctsforrequire. They replacedist/index.d.tsand the per-file declarations that 1.9.0 shipped underdist/components/anddist/types/.package.jsonnow sets"main": "./dist/index.cjs","module": "./dist/index.mjs", and"types": "./dist/index.d.cts". Its newexportsmap hasimportandrequireconditions for the package root and also exposes./package.json."sideEffects": false, that lets them drop the lightbox entirely from an app that imports it without rendering it.import Lightbox, { ImagesListType } from 'react-spring-lightbox'works as before, andrequire('react-spring-lightbox')still returns the component itself, not{ default }.export =, which matchesmodule.exports = Lightbox. The 1.9.0 declarations usedexport default, so TypeScript projects compiling to CommonJS under"module": "node16"or"nodenext"expected a.defaultproperty that does not exist at runtime.import Lightbox = require('react-spring-lightbox')now type-checks as well.reactinstead of relying on the globalReactnamespace that@types/reactdeclares.Upgrade notes:
dist/now fail, because theexportsmap exposes only the package root and./package.json. Node.js reportsERR_PACKAGE_PATH_NOT_EXPORTED, and bundlers report that the package path is not exported. Import fromreact-spring-lightboxinstead, and replace imports ofdist/types/ImagesListwithimport type { ImagesListType } from 'react-spring-lightbox'.dist/index.cjs.jsdirectly needs to name the package instead.4ecc7a7: The open lightbox is now a modal dialog that keyboard and screen reader users can work with, and it gives focus back when it closes.
role="dialog",aria-modal="true", andtabindex="-1". The new optional propsaria-labelandaria-labelledbyname the dialog. Without either prop, screen readers announce a dialog with no name.autoFocusinrenderHeader. With 1.9.0, focus stayed on the element that opened the lightbox, under the overlay. After a keyboard user opened an image with Enter and paged with the arrow keys, the next Enter pressed that hidden thumbnail again and jumped back to its image.<body>has theinertattribute, so Tab and screen readers can't reach the page behind it. With 1.9.0, Tab moved through the whole page behind the overlay before it reached the lightbox's own controls. Elements added to<body>after the lightbox opens, such as a menu that a header button portals to<body>, stay usable.inertattributes that it added and moves focus back to the element that had focus before it opened. With 1.9.0, pressing a close button inside the lightbox dropped focus to<body>, so the next Tab started from the top of the page.inlinelightbox doesn't change.Upgrade notes:
If a screen reader announces your lightbox only as "dialog", the dialog has no name. Pass
aria-label, or passaria-labelledbywith theidof a title in your header.Before:
After:
If your page keeps a control usable over the open lightbox, such as a toolbar that sits above it with a higher
z-index, that control is now inert while the lightbox is open. Clicks and Tab skip it. To check, open the lightbox and look for aninertattribute on the control or one of its ancestors in your browser's element inspector. To keep the control usable, render it inrenderHeader,renderFooter, orrenderImageOverlay.Before:
After:
If your
onClosehandler moves focus to another element, focus now ends on the element that opened the lightbox instead. The lightbox moves focus back afteronClosereturns, so it overrides afocus()call inside the handler. Move focus in auseEffectthat runs whenisOpenchanges tofalse, in the component that renders<Lightbox>. That effect runs after the lightbox moves focus back.Before:
After:
In a browser that doesn't support the
inertattribute, Tab and screen readers can still reach the page behind the open lightbox, as they could with 1.9.0. If your app supports such browsers, load aninertpolyfill such aswicg-inert.3a4933c: Require Node.js
^22.18.0 || ^24.11.0 || >=26.0.0and npm>=10.9.0inengines, up from Node.js>=16and npm>=7.preparescript, which builds it withrolldown-plugin-dts, and that plugin supports only these Node.js versions.npm warn EBADENGINE Unsupported engineand installs anyway. Withengine-strict=true, npm stops withnpm error code EBADENGINE. Yarn 1 always stops, withThe engine "node" is incompatible with this modulefollowed byerror Found incompatible module. Upgrade Node.js, or skip the check withyarn install --ignore-enginesornpm install --engine-strict=false.3cd50c2: Support React 19 by moving to
@react-spring/web10, and fix two-finger pinch zoom stopping after its first step under React 19.dependenciesnow has@react-spring/web^10.1.2, up from^9.7.3. Version 9 declaresreactandreact-dompeers of^16.8.0 || ^17.0.0 || ^18.0.0, and version 10 adds^19.0.0. The lightbox's own peers stayreact >=16.8andreact-dom >=16.8.npm warn ERESOLVE overriding peer dependencyand installs@react-spring/web9.7.5 anyway. With--strict-peer-deps, npm stops withnpm error code ERESOLVEand lists@react-spring/web@"^9.7.3" from react-spring-lightbox@1.9.0underCould not resolve dependency:. This release installs next to React 19 without either message.ImagePagermarked itself as dragging and cancelled the drag. Its drag-end handler cleared that flag only inside anif (isDragging)check, which read a stalefalsebecause React 19 had not yet re-rendered the pager with the new value. The flag stayed set, and the image ignores pinches while the pager is dragging. The drag-end handler now always moves the pages back to their resting positions and clears the flag 100 ms after the gesture ends.Upgrade notes:
@react-spring/web9, npm installs a second copy for the lightbox, andnpm ls @react-spring/weblists 9.x at the top level and 10.x underreact-spring-lightbox. Your bundle then carries both copies. Settings you apply throughGlobals.assign, such asskipAnimationin a test setup file, reach only your copy, so the lightbox's springs keep animating. Move your app to@react-spring/web10 so both share one copy.Patch Changes
1ae0e83: Dragging, swiping, scrolling and paging through a large gallery takes less CPU time, because the lightbox now animates only the current image and its neighbors.
images, including the hidden images more than one page away. Each of those springs then wrote a CSS transform on every animation frame. In Chromium, a 1.3-second drag over a 1000-image gallery wrote 117,000 transforms.ed76418: Replace the deprecated
react-use-gesturewith its successor,@use-gesture/react, so installing the lightbox no longer prints a deprecation warning (react-use-gesture is deprecated #52).dependenciesnow has@use-gesture/react^10.3.1in place ofreact-use-gesture9.1.3. Itsreactpeer range,>= 16.8.0, matches the lightbox's.npm warn deprecated react-use-gesture@9.1.3: This package is no longer maintained. Please use @use-gesture/react instead. This release installs without it.Upgrade notes:
react-use-gesture. If your app imports it without listing it in its owndependencies, runnpm ls react-use-gestureto see whether anything else still installs it, and add it to yourdependenciesor move to@use-gesture/react.TypeError: event.target.setPointerCapture is not a function, because jsdom has no pointer capture. GiveElement.prototypeno-opsetPointerCapture,releasePointerCapture, andhasPointerCapturemethods in your test setup.target. The click after a drag is ignored only when itsdetailis above 0, as a mouse or touch click's is, andfireEvent.clicksendsdetail: 0unless you pass one.@use-gesture/reactchecks for touch events and Safari'sGestureEventonce, when it loads. A test that emulates desktop Safari by removingontouchstartor addingGestureEventmust do it before anything imports the lightbox, such as invi.hoisted().455e260: The page behind the open lightbox no longer scrolls.
touch-action: none.overflow: hiddenon<html>while it is open. Neither touch nor the keys that a text field or a menu portaled to<body>leaves to the browser scroll the page behind it. When the last open lightbox closes, it puts back the inlineoverflowandpadding-rightthat<html>had when the first one opened, and the page is where it was.padding-rightof<html>while it is open, so the page's content doesn't shift when the scrollbar goes away. An element withposition: fixedandright: 0still moves right by the scrollbar's width while the lightbox is open, 15px in a WebKit test. A scrollbar that overlays the page, as on macOS with a trackpad, takes up no space and adds no padding.inlinecarousel leaves the page alone.::-webkit-scrollbar. Not tested in Safari on iOS, or on a real touchscreen.Upgrade notes:
If your app sets
overfloworpadding-righton<html>while the lightbox is open, for example to stop the page from scrolling, you can remove that code. If you keep it, set it beforeisOpenturns true, and remove it after the lightbox closes. When the last open lightbox closes, it puts back the inline values that<html>had when the first one opened, so a value that your app sets while a lightbox is open doesn't stay.Before:
After:
21ebe89: One trackpad swipe now pages one image, instead of paging through many as its scroll slows down.
onNextoronPrev22 to 63 times.Upgrade notes:
ed76418: Fix the image zooming further after the fingers lift from a pinch, so it keeps the zoom the pinch ended on (Pinch zoom on iPad causes final image position to jump #17).
@use-gesture/reactdoesn't, and the lightbox no longer cancels a pinch that is already ending.ed76418: Only the primary mouse button drags now, so a drag with the right or middle button no longer pages the gallery or pans a zoomed-in image.
@use-gesture/reactstarts a drag only for the primary button by default, and the lightbox keeps that default.1ae0e83: Opening the lightbox renders each image once instead of twice.
max-height: 100%, then rendered every image again with the stage height minus 50px. It now uses the stage height in its first render.0ea271f: Widening the window no longer shows the images beside the current one sliding into view.
Upgrade notes:
If a test of your app reads the
transformof a.lightbox-image-pagerelement and expects pixels, it now gets a percentage of the stage width.Before:
After:
3a4933c: Build with Rolldown and TypeScript 7 instead of Rollup, Babel, and TypeScript 5, and drop the
@babel/runtimedependency.dependenciesno longer lists@babel/runtime. The 1.9.0 bundle required@babel/runtime/helpers/defineProperty,@babel/runtime/helpers/extends, and@babel/runtime/helpers/objectWithoutProperties, and neither bundle needs them now.rolldown-plugin-dtsbundles them into one file per module format.ed76418: In desktop Safari, ctrl + wheel now zooms the image toward the cursor, as it already did in Chrome, Edge, and Firefox.
ctrlKeyset left the image alone.@use-gesture/reactlistens for both.868eb05: The lightbox's keys now act only while focus is inside it, so text fields, selects, and the page around an inline carousel keep their own keys (Keyboard keys hardcoded and captured all the time #65).
documentwheneverisOpenwas true. ← and → paged the lightbox while you typed in a text field in its header or footer, and Home, End, ↑, ↓, PageUp, and PageDown did nothing in that field. Escape closed the lightbox even after the field calledpreventDefault(). An inline carousel took ←, →, and Escape from the whole page, even when it was scrolled out of view, and blocked the keys that scroll the page. Every mounted lightbox reacted to each key.onKeyDownon its dialog, or on the carousel's root withinline. Keys pressed elsewhere on the page don't reach it.<body>when the focused control turns disabled or leaves the page, as a Next button rendered withdisabled={!canNext}does on the last image. Such a key also moves focus back into the lightbox. Tab then goes to its first control and Shift+Tab to its last.preventDefault()in its ownonKeyDown.compositionendfirst and marks thatkeydownonly withkeyCode229. With 1.9.0, the lightbox didn't check for composition, so the Escape that cancels a Chinese or Japanese composition could close it.<body>, are left to that content. Aninlinecarousel never blocks these keys.keydownthat Safari sends. It was not tested in Safari with an input method.Upgrade notes:
If keyboard users page your inline carousel with ← and → while focus is elsewhere on the page, the carousel now ignores those keys. It takes them only while focus is inside it. Render buttons with
renderPrevButtonandrenderNextButton, so keyboard users can move focus into the carousel.Before:
After:
A button that turns
disabledwhile it has focus, as these do at the first and last image, drops focus to the page. The carousel then takes no keys until focus is back inside it.If a test of your app fires key events at
document, or fires onlykeyup, the lightbox no longer sees them. Firekeydownat the focused element, as a browser does.Before:
After:
1ae0e83: Page changes in very large galleries take less time, because hidden images now move without starting an animation.
set(). They end each page change in the same place as before, and the current image and its neighbors animate as before.currentIndextwice within one animation frame, a hidden page that was still moving now starts again from where it is, at rest, instead of keeping its speed.currentIndexmoves to keep it in view, leaves it still. Tested together with the other performance changes in this release, with the unit tests on React 19 and React 18.3.1, the Playwright tests in all five browser projects on React 19, and the Chromium Playwright tests on React 18.3.1. The timings come from Chromium only. Timings on real phones, in Firefox and in Safari weren't measured.3a4933c: Ship
CHANGELOG.mdin the npm package, so the release notes are innode_modules/react-spring-lightbox/CHANGELOG.mdafter an install.filesinpackage.jsonnow listsCHANGELOG.mdandMIGRATION.mdnext todist. Through 1.9.0, the package held onlydist/,package.json,README.md, andLICENSE, so the release notes were only on GitHub.MIGRATION.mdyet. The first release that needs a step-by-step migration guide ships one atnode_modules/react-spring-lightbox/MIGRATION.md.1ae0e83: Paging, zooming and closing a large gallery no longer re-renders every image.
images. Each render also removed and re-added eight event listeners on the image. Four arrow-key presses in a 1000-image gallery rendered images 4,000 times and added 32,008 listeners.imagesin place, keeping the same object, an image more than one page away now picks up the change when it comes within one page of the current image, instead of on the next render. The current image and its neighbors pick it up on the next render, as before.9e8f9c9: Jumping to a distant image now slides the old image out and the new one in, as a one-step page change does.
currentIndexby more than one, as a thumbnail click does, hid the old image at once. The stage stayed blank until the new image arrived from as many stage widths away as the jump, and the new image's neighbor streaked across the stage first. In Chromium, after a jump from image 1 to image 50 of 60, the new image took about 460ms to reach the stage.currentIndexthat keeps the same image in view, as when images are added before it, is not a jump. The image now stays still even when it lands on a page that showed another image, where 1.9.0 slid it in from the side.Upgrade notes:
display: noneright after a jump, it now keepsdisplay: flexfor about 0.7 seconds while the image slides off. Wait for the slide to end, for example with Playwright'stoHaveCSS('display', 'none')on that image's.lightbox-image-pagerelement, which retries until it passes.