fluentui
fluentui copied to clipboard
usePopper: define boundaries with imperative handles
Describe the feature that you would like added
We need to allow define flipBoundary and overflowBoundary with imperative handles, similarly to setTarget.
function App() {
const popperRef = React.useRef();
const { targetRef, containerRef, arrowRef } = usePopper({
popperRef
});
React.useEffect(() => {
popperRef.setFlipBoundary(el);
}, []);
}
Why?
Currently flipBoundary & overflowBoundary can be defined as elements only ➡️ this requires to use refs via React.useState():
function App() {
const [flipBoundary, setFlipBoundary] = React.useState();
return <div ref={setFlipBoundary} />;
}
This causes an additional re-render as such boundaries usually wrap a lot of components this results in performance issues. Using imperative handlers allows to avoid passing refs ➡️ additional re-renders.
What component or utility would this be added to
usePopper hook in @fluentui/react-positioning
The issue was updated to propose extending existing imperative handle. With the previous proposal (functions) we cannot handle updates of refs properly.
This has been northstar request, currently not blocking anybody.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.