- #739
705cc19Thanks @TylerJDev! - Focus-trap: Add option to prevent scrolling when programmatically setting focus.
- #681
09af9adThanks @francinelucca! - fix(getAnchoredPosition): add better support for floatingElements inside dialogs through new "displayInViewport" setting
-
#685
de1a034Thanks @copilot-swe-agent! - Fix IndexedSet stack overflow and optimize performanceFixes:
- Fix
RangeError: Maximum call stack size exceededwhen inserting large numbers of elements (50k+) in focus zones - Changed
insertAtAPI from rest parameters to array parameter to avoid call stack issues
Performance improvements:
- Optimize
indexOf()from O(n) to O(1) using a Map for index lookups - Optimize
delete()from O(2n) to O(n) by using the index map - Add fast paths for common insertion patterns (append to end, prepend to start)
Note: This is a minor API change -
insertAt(index, ...elements)is nowinsertAt(index, elements). Callers should pass an array instead of spreading arguments. - Fix
- #668
15b49abThanks @TylerJDev! - Focus-zone: Reinitialize focus zone when new items are added and focusPrependedElements istrue
- #661
419bcf0Thanks @copilot-swe-agent! - OptimizegetAnchoredPositionby reducinggetComputedStylecalls- Combine DOM traversals for positioned parent and clipping node lookups into a single pass
- Cache computed styles during traversal to avoid redundant
getComputedStylecalls - Reduce calls from
2n + 2tonfor DOM trees of depthn(57% reduction for typical cases) - Improve performance for anchored positioning with deep DOM trees
-
#665
7fa6e9aThanks @kelsey-myers! - [Focus Zone] Fix edge-case where prepended element is not focused when elements are reordered -
#657
457a1fbThanks @mattcosta7! - Optimize DOM operations for better web vitals (INP, CLS, FID)- Batch reflow-causing reads in
isFocusable()to minimize layout thrashing - Use
Setfor O(1) tag lookups instead ofArray.includes() - Optimize
getClippingRect()andgetPositionedParent()with early exits - Batch MutationObserver DOM operations (read phase, then write phase)
- Add sr-only inline styles to focus-trap sentinels to prevent CLS
- Use
:scopeselector for faster direct-child sentinel lookup - Add
IndexedSetfor O(1) membership checks in focus zone hot paths
- Batch reflow-causing reads in
-
#648
0cd03c3Thanks @TylerJDev! - FocusZone: Introduce a new focusInStrategy option, "initial," to allow disabling the default behavior of focusing on the first item when the focus zone becomes active. -
#641
cd90185Thanks @TylerJDev! - FocusZone: Add settingignoreHoverEventswhich provides a configurable setting to disable selection on mouse hover
- #623
f539ae5Thanks @iansan5653! - Fix cursor position checks to excludeselectelements
- #597
43f432aThanks @iansan5653! - ExposeisEditableElementutil
- #594
5cd0b90Thanks @iansan5653! - Respectcontenteditableelements when checking for editability infocus-zonebehavior
- #473
d88c043Thanks @TylerJDev! - Prevent duplicate sentinels from being added if some already exist in the container of the focus trap.
- #462
62dc90aThanks @camertron! - Ensure focusZone() clears all potential active descendants
- #429
4b729b0Thanks @TylerJDev! - Adds mutation observer tofocus-trapto ensure sentinel elements are always in the correct position
- #421
fd1419aThanks @joshblack! - Remove optionalDependencies from npm package
- #400
67215a5Thanks @joshblack! - Update the output of the package to correctly map "import" conditions to ESM
- #263
5d7e0b1Thanks @TylerJDev! - Adjusts mutation observer to now trackhiddenanddisabledattributes being applied or removed.
- #399
3a3cd61Thanks @JelloBagel! - Fix bug found when removing nodes in a focus zone with strict mode enabled
- #245
caf30c4Thanks @pksjce! - When zoomed in, an overlay floating element should anchor itself properly instead of getting the top part cut off in the process
- #241
cb98837Thanks @JelloBagel! - Add support for contenteditable to iterateFocusableElements
- #235
7a7faa9Thanks @JelloBagel! - Add IterateFocusableElements options to focusZone
- #208
2042afcThanks @EnixCoda! - Updateanchored-position.tsto support handling elements outside ofdocument.bodyingetClippingRect
- #195
bddd6c5Thanks @keithamus! - Special case anchored-position calls on top-layer elements
- #180
eca845bThanks @colebemis! - FocusZone: If customfocusInStrategyis defined, use it to initialize tabIndexes
- #176
5e74867Thanks @jbrown1618! - Use a binary search to find the insertion index for new elements managed by the focus zone. For a use case with 1000 elements managed by the focus zone, added one at a time (by react), this takes us from 500,000 calls tocompareDocumentPositionover 1000ms to 8,000 calls over 16ms.
- #155
b14b5acThanks @colebemis! - focusZone: Add Backspace key to list of FocusKeys
- #152
afaf380Thanks @colebemis! - focusZone: AddpreventScrolloption
- #93
e5aaf68Thanks @siddharthkp! - Anchored position: Add check for boundary collision on left side
- #78
62e5459Thanks @siddharthkp! - Anchored Position: Add alternative alignments to flip to if there isn't enough space
- #73
a96d60fThanks @dgreif! - Addimportconditional export type to the package for better NodeJS ESM compatibility
- #52
1aa3027Thanks @owenniblock! - Update focusTrap to use new methodology after accessibility discussions