Repository navigation
v2.4.0
Highlights
Inputworks on mobile keyboards. Text no longer lags one key behind on Android (#257, #219), keyboard suggestions replace the word instead of duplicating its last letter (#253), and composition, autocorrect and paste are handled by the browser. The hidden native field now owns the text, caret and selection, so arrows, Shift-selection, Ctrl/Cmd+A, double/triple click, drag-selection and copy/cut/paste all work (#10), and overflowing text scrolls to keep the caret in view. Tested on Chromium, Firefox and Safari on macOS, iOS Safari and Android Chrome. New option:inputAttributes.- New
Drawercomponent — a modal drawer, with container options support (#248, #273, #278). - Container options on elements (#260).
- ScrollBox and List fixes — scroll limits follow the current size, content sizing, faster bulk
addItems, and correct positioning of anchored or pivoted children. - No more
typed-signalsdependency — signals are now built in, so the UMD bundle (dist/pixi-ui.js) no longer needs atypedSignalsglobal, and the ESM build tree-shakes.SignalandSignalConnectionare exported from the package;onX.connect(...)works as before (#283).- Fixed in v2.4.1: the 2.4.0 UMD bundle expected
tweedle.jsas the globalTweedle, but tweedle.js registerstweedle_js, so it failed withTweedle is not defined. Use 2.4.1, or on 2.4.0 addwindow.Tweedle = window.tweedle_js;between the tweedle.js and @pixi/ui scripts.
- Fixed in v2.4.1: the 2.4.0 UMD bundle expected
- Robustness — a pass over crashes, argument guards, numeric validation and resource cleanup, with the test suite now covering 95% of the library.
Behaviour changes worth knowing
None of these change the documented public API, but code that relied on the old behaviour may notice:
Input, protected API — breaking for subclasses: typed text now comes from the hidden native field'sinputevent, so the methods subclasses used to customise typing are no longer called for it.onKeyUpis renamed toonKeyDown(the event it was always bound to),onPasteandlastInputDataare removed,_add()and_delete()still exist but typing no longer goes through them, andonInput()no longer receives the event. AnInputsubclass that overrides any of these now logs a one-time console warning naming the method (#282).- If you overrode
onKeyUpas a workaround for #257, remove the override — it is no longer needed. - If you filtered or rewrote characters in
_add(), move that into anonInput()override that adjuststhis.input.valuebefore callingsuper.onInput():class NoDigits extends Input { protected override onInput(): void { if (this.input) this.input.value = this.input.value.replace(/\d/g, ''); super.onInput(); } }
- If you overrode
- Signals: if you annotated fields with the
Signaltype imported fromtyped-signals, importSignalfrom@pixi/uiinstead — the two classes are not assignable to each other. Calls such asonPress.connect(...)need no change (#283). Input: settingvaluewhile the user is editing now updates the field being edited, andonChangeis not emitted for it.Button.view = nullis ignored and keeps the current view, instead of throwing.fitToViewthrows a clear error for anundefinedchild, instead of failing later.ScrollBoxsizes itself to its content, an explicitwidth/heightwins over that, and0is treated as a real value rather than "not set".removeItems()now recomputes the scroll limits.Listpositions children with an anchor or pivot by their visual corner; children without one are unaffected.
What's Changed
- Improve safety checks in resize.ts & fit.ts by @jeth88 in #255
- fix(FancyButton): Added missing null-check in fancy button by @CatchABus in #259
- feat: added support for setting container opts to elements by @CatchABus in #260
- Add a modal Drawer component by @afarber in #248
- feat(Drawer): support container options, docs and story fixes by @CyberDex in #273
- test: raise coverage to 95% and pin 45 known defects by @CyberDex in #265
- docs(Drawer): improve docs and fix story controls by @CyberDex in #274
- fix: repair five outright crashes and copy/paste errors by @CyberDex in #266
- chore: fix lint in the test files from #265, and stop the eslint config cascade by @CyberDex in #275
- fix: guard public entry points that dereference their argument by @CyberDex in #267
- fix: validate numeric inputs before they reach arithmetic by @CyberDex in #276
- fix: validate before mutating, not after by @CyberDex in #269
- fix: release resources acquired in constructors by @CyberDex in #270
- test: cover the Drawer component and pin three defects by @CyberDex in #277
- fix: size ScrollBox to its content, and stop treating 0 as an absent value by @CyberDex in #279
- fix: release Drawer resources, validate its background, re-anchor on resize by @CyberDex in #278
- test: pin the reported symptoms from #226, #227 and #252 by @CyberDex in #280
- fix: ScrollBox derives its scroll limits from its current size by @CyberDex in #261
- fix: List positions children by their visual corner, not their origin by @CyberDex in #264
- perf: add ScrollBox items in one pass instead of one at a time by @CyberDex in #263
- fix: Input mirrors the native field instead of rebuilding text from keydown by @CyberDex in #262
- chore: align Checkbox Use Html story with Use Graphics by @CyberDex in #281
- feat: Input warns about subclass overrides that typing no longer calls by @CyberDex in #282
- chore: replace typed-signals with an internal Signal by @CyberDex in #283
- docs/fix: correct Input API docs, fix Drawer animation races, add release checklist and E2E runner by @CyberDex in #284
New Contributors
Full Changelog: v2.3.2...v2.4.0