floating-ui

A JavaScript library to position floating elements and create interactions for them.

MIT License

Downloads
202.3M
Stars
28.6K
Committers
104

Bot releases are visible (Hide)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Performance Improvements

  • perf: reduce initial re-renders (#1700)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • fix(autoUpdate): normalize behavior to always call update function immediately (#1701)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • fix(arrow): when padding is specified, the coordinates of the floating element are now adjusted if needed to ensure the arrow continues to point at the center of the reference element. This takes precedence over start and end alignments. (#1496)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • feat(useListNavigation): openOnArrowKeyDown and disabledIndices props (#1690)

Bug Fixes

  • fix(useHover): avoid setTimeout wrapper if delay is an object but the individual value is set to 0 (#1638)

  • fix(FloatingOverlay): only use position: fixed technique on iOS and account for visual viewport offsets during pinch-zoom (#1693)

  • fix(useHover): close on scroll mouseleave when using safePolygon (#1694)

  • fix(useListNavigation): focusItemOnOpen logic (#1638)

  • fix(safePolygon): handle floating point errors (#1694)

  • fix(useListNavigation): off-by-one error when activeIndex is not initially set and allowEscape: false (#1638)

  • fix(useListNavigation): use mouse not pointer events for hover focus sync to prevent unwanted sync while scrolling on touch devices (#1638)

  • fix(FloatingFocusManager): prevent trapping focus if reference is specified in order and modal: false (#1638)

  • fix(useFocus): open not changing if the window blurred and the reference element is the first element in the tab order (#1638)

  • fix(useClick): keyboard Enter click requiring two presses after using pointerDown in certain situations (#1638)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Refactors

  • @floating-ui/core v0.7.0 changes package entry points. (#1678)

  • @floating-ui/core v0.7.0 has breaking changes. (#1674)

Bug Fixes

  • fix: getDimensions platform method (#1685)

    Arrows now work correctly in React Native

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • Add useFloatingPortalNode hook for better interop with other portals in other libraries (#1672)

  • Introduce a new whileElementsMounted callback prop to simplify usage of autoUpdate. (#1683)

Refactors

  • @floating-ui/core v0.7.0 has breaking changes. (#1674)

  • Replaced .cjs file with .mjs and removed module type from package. Fixes CJS support in create-react-app. (#1678)

Bug Fixes

  • fix(types): prevent error at useHover safePolygon when using a narrow reference type (#1665)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • Introduce a new whileElementsMounted callback prop to simplify usage of autoUpdate. (#1683)

Refactors

  • @floating-ui/core v0.7.0 has breaking changes. (#1674)

  • Replaced .cjs file with .mjs and removed module type from package. Fixes CJS support in create-react-app. (#1678)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • Added "browser" export conditions (#1666)

    BREAKING: removed the previous "production" and "development" export conditions. The new "browser" key is a replacement for this. See Package entry points.

Refactors

  • @floating-ui/core v0.7.0 has breaking changes. (#1674)

  • Replaced .cjs file with .mjs and removed module type from package. Fixes CJS support in create-react-app. (#1678)

Bug Fixes

  • Avoid navigator audit message in Chrome DevTools (#1663)

  • fix(autoUpdate): retain floating element's ResizeObserver when elementResize: true and animationFrame: true (#1673)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • Added "browser" export conditions (#1666)

    BREAKING: removed the previous "production" and "development" export conditions. The new "browser" key is a replacement for this. See Package entry points.

Refactors

  • The size apply callback and offset callback signatures have changed to be more ergonomic, especially in React. (#1674)

    BREAKING: The parameters width and height passed into size() middleware apply function are now named availableWidth and availableHeight, which better represents what the values are.

  • Replaced .cjs file with .mjs and removed module type from package. Fixes CJS support in create-react-app. (#1678)

  • BREAKING: In both the size() and offset() middleware, the reference and floating top-level parameters are now namespaced under rectsrects.reference and rects.floating. (#1674)

    The entire MiddlewareArguments object gets spread in, so there's more data to access if needed.

Bug Fixes

  • fix(arrow): fallback to the floating element as the offsetParent (#1685)

    React Native / other platforms that do not implement getOffsetParent

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • feat(useClick): add keyboard handlers for non-button elements used as the reference element (#1652)

  • feat(useClick): add ignoreMouse prop (#1652)

Refactors

Bug Fixes

  • Improve hover and focus sync logic (#1646)

  • Fix shadow DOM support (#1650)

    Checks for the activeElement inside shadow roots and detecting pointerdown events inside shadow roots. Fixes floating elements nested inside shadow doms being wrongly closed when a pointerdown occurs inside the floating element.

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • fix(FloatingDelayGroup): use 1ms open delay (#1635)

  • fix(FloatingFocusManager): import React (#1634)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • Include LICENSE file in npm package (#1626)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • feat(useListNavigation): allowEscape prop (#1631)

  • New <FloatingFocusManager /> component (#1628)

    DEPRECATED: useFocusTrap is no longer recommended. Use this component instead.

  • feat(useClick): toggle prop (#1633)

Bug Fixes

  • fix(useTypeahead): improve dataRef typing detection (#1627)

  • fix(useListNavigation): allow nullish items (#1630)

    Supports list virtualization

  • fix(useTypeahead): use .toLocaleLowerCase() (#1632)

  • Include LICENSE file in npm package (#1626)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • Include LICENSE file in npm package (#1626)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • fix(types): export AutoUpdateOptions (#1623)

  • Prevent crash in browsers without ShadowRoot support (#1621)

  • Include LICENSE file in npm package (#1626)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • Include LICENSE file in npm package (#1626)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • feat(safePolygon): expose and document restMs + buffer options (#1620)

Bug Fixes

  • Allow undefined passed as an event listener prop value in prop getters (#1614)

    getFloatingProps({onKeyDown: undefined})

  • Do not close floating element on blur when focus goes to nested floating elements within a portal (#1619)

  • fix(restMs): handleClose in a deep tree (#1616)

  • fix(useListNavigation): reset index in pointer leave (#1617)

  • Simplify useInteractions prop merging logic (#1614)

  • fix(restMs): allow infinite delay (#1616)

    If restMs is specified, and delay is 0 (the default), then delay is infinite (i.e. a no-op)

  • feat(types): allow specifying narrower reference type in useFloating() (#1615)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • Fix single frame positioning glitches in React 18 (due to batched updates) (#1613)

  • feat(types): allow specifying narrower reference type in useFloating() (#1615)

floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

Bug Fixes

  • fix(types): React 18 types (remove React.FC) (#1610)
floating-ui - @floating-ui/[email protected]

Published by github-actions[bot] over 2 years ago

New Features

  • useClick pointerDown option (#1609)

    For faster feedback, if wanted

  • useDismiss bubbles option (#1609)

    Determines if dismissals bubble through an entire FloatingTree or not

  • useListNavigation now handles pointer listeners automatically, navigation focus is synchronised on hover (#1609)

    getItemProps is now returned from useInteractions() to enable this, plus, a focusItemOnHover option to disable if wanted

Bug Fixes

  • Fix selectedIndex when not null from stealing page focus on mount (#1609)

  • Nested FloatingOverlays (e.g. modals) and scroll locks are now correctly handled (#1609)

  • Removed limitation where modal: true in useFocusTrap required a Portal (#1609)

  • Reduce re-renders (#1609)