A JavaScript library to position floating elements and create interactions for them.
restoreFocus
prop. This enables automatic restoration of focus to the nearest tabbable element if the element that currently has focus inside the floating element is removed from the DOM.const [value, setValue] = React.useState(0);
const offset1 = offset(value); // reactive
const offset2 = offset(() => value); // NOT reactive
const offset3 = offset(() => value, [value]); // reactive
This also includes size
's apply
function:
size(
{
apply() {
value; // reactive
},
},
[value],
);
const [value, setValue] = React.useState(0);
const offset1 = offset(value); // reactive
const offset2 = offset(() => value); // NOT reactive
const offset3 = offset(() => value, [value]); // reactive
This also includes size
's apply
function:
size(
{
apply() {
value; // reactive
},
},
[value],
);
scrollIntoView
and focus
behavior with virtual focus and inner DOM-focused element + FloatingList
undefined
id with unconditional rendering in React <18selectedIndex
changes from stealing focusdisabledIndices
is inferredscript
tags needlessly@floating-ui/[email protected]
useFloatingRootContext
Hook, which enables calling interaction hooks in a component higher in the tree than useFloating
is called in. This supports spreading reference props onto an "external" reference element. External reference documentation.