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

Bug Fixes

  • fix(useHover): clear pointer-events: none style when enabled prop changes, or if the cursor is outside the safe polygon. Further, prevent adding it if the open event was not caused by hovering when using multiple open state-changing hooks like useFocus. (#1808)

    A hide delay meant outside interaction was not possible until it was dismissed via pointerdown or escape during the delay.

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

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

Refactors

  • @floating-ui/core bumped to 1.0.0 (#1796)

Bug Fixes

  • fix: check name for middleware array comparisons (#1796)
floating-ui - @floating-ui/[email protected]

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

Refactors

  • @floating-ui/react-dom bumped to 1.0.0 (#1796)

Bug Fixes

  • fix(useDismiss): prevent bubbles: false failing to close lower level nested floating elements on pointerdown outside (#1797)

  • fix: useClick + useHover behavior when both hooks are used in conjunction (#1802)

Performance Improvements

  • pkg: remove use-isomorphic-layout-effect from installed deps (#1796)
floating-ui - @floating-ui/[email protected]

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

Breaking Changes

  • @floating-ui/core bumped to 1.0.0 (#1796)

  • UMD package files now have .umd in the filename (#1796)

Bug Fixes

  • fix: allow unstable inline ref callbacks (#1796)

  • fix: check name for middleware array comparisons (#1796)

Performance Improvements

  • pkg: remove use-isomorphic-layout-effect from installed deps (#1796)
floating-ui - @floating-ui/[email protected]

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

Breaking Changes

  • @floating-ui/core bumped to 1.0.0 (#1796)
floating-ui - @floating-ui/[email protected]

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

Breaking Changes

  • limitShift offset function option now gets whole MiddlewareArguments object spread in to match other APIs (#1796)

Refactors

  • refactor(size): apply function now has await before it to allow async updates (#1796)
floating-ui - @floating-ui/[email protected]

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

New Features

  • feat: inner middleware — the floating element is anchored such that an inner element inside of it sits on top of/is anchored to the reference element. (#1758)

    This works along the y-axis and simulaneously limits the max-height of the floating element.

  • feat: useInnerOffset interaction hook — allows the height of the floating element to expand on wheel event by changing the offset that inner uses to anchor the inner element (#1758)

Refactors

  • refactor: returning focus to the reference element is now exclusively handled via FloatingFocusManager. useListNavgation and useDismiss no longer return focus, bypassing issues with unmounting animations. (#1765)

Bug Fixes

  • fix(useDismiss): outsidePointerDown now uses real pointerdown instead of mousedown (#1765)

    Before it required an "intentional" dismiss on touch devices, but now, the user can dismiss while attempting to scroll away

  • fix(useHover): prevent SVG reference element from failing to apply pointer-events auto styles (#1794)

  • fix(useClick): pointerDown now uses mousedown instead of pointerdown. This reduces unintentional clicks while touching the screen to scroll, or focus being moved to focusable items inside a floating element unintentionally when tapping the reference element. (#1765)

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

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

Bug Fixes

  • fix: prevent unwanted scrolling when dismissing via outside pointerdown, which occurs when the reference element is no longer visible on the screen (i.e. the user scrolled away while a popover was open, then clicked outside it to dismiss it). (#1752)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

  • fix(autoUpdate): avoid the initial update in a microtask (called by the ResizeObserver) due to a timing problem with .focus calls being invoked before the position is ready. (#1755)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

  • fix: store real DOM reference in place of refs.reference. Now you can use virtual elements for positioning without affecting the logic of the interaction hooks which expect a real DOM element. (#1748)

  • fix(useHover): 0 close delay not clearing open timeout (#1749)

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

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

Bug Fixes

  • TS typedefs are now generated as "strict" (#1735)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

  • fix(useClick): if the initial open state is true, clicking the reference element to toggle it closed now works without two clicks (#1743)

  • fix(types): useFloatingPortalNode return type (#1735)

  • TS typedefs are now generated as "strict" (#1735)

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

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

Bug Fixes

  • TS typedefs are now generated as "strict" (#1735)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

  • TS typedefs are now generated as "strict" (#1735)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

  • TS typedefs are now generated as "strict" (#1735)

  • fix: add safeguard return to bail out of positioning after 50 reset requests, preventing any infinite loops, even if more resets are requested. In DEV mode, the error about the positioning loop is now just a warning. (#1742)

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

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

Bug Fixes

  • fix(safePolygon): prevent failing in React <18 (#1734)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

  • fix(FloatingPortal): useFloatingPortalNode uses state instead of a ref to ensure a re-render is triggered (#1715)

  • fix: add missing react and react-dom peer dependencies in package.json (#1727)

  • fix(FloatingFocusManager): shift+tab outside reference element closes floating element (#1723)

  • fix(useHover): block pointer-events when using safePolygon (#1724)

    As a result, the DropdownMenu CodeSandbox example now no longer needs to block sibling list items' pointer-events to prevent other submenus from opening as the cursor traverses the polygon.

  • fix(useFocus): pointerDown on reference, then shift+tab outside the reference when it was first in the focus order (window blurred) now runs the focus handler when tabbing back into it (#1732)

  • fix(useClick): enabling pointerDown no longer responds to right click or other mouse buttons, only the "main" button (#1732)

  • fix(FloatingFocusManager/useClick): improve isInputCombobox() check by checking for typeability (incl. textarea and contenteditable elements). In addition, a Space keyboard handler is no longer added for useClick() when the reference is typeable (#1732)

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

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

Bug Fixes

  • fix(types): missing DOM types for elements in MiddlewareArguments signatures (#1733)
floating-ui - @floating-ui/[email protected]

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

Bug Fixes

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

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

Bug Fixes

  • fix(useListNavigation): set index to null if out of bounds (#1702)

    aria-activedescendant is now removed by default when the index escapes the list

  • fix(useHover): clear timeouts on unmount to prevent React warning in <18 (#1707)

  • fix(FloatingFocusManager): add aria-hidden handling for comboboxes to allow them to be portalled and accessible to touch-based screen readers (#1706)

Performance Improvements

  • perf: bump @floating-ui/react-dom to reduce initial re-renders (#1700)