Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usePopper: define boundaries with imperative handles #21322

Open
layershifter opened this issue Jan 18, 2022 · 7 comments
Open

usePopper: define boundaries with imperative handles #21322

layershifter opened this issue Jan 18, 2022 · 7 comments

Comments

@layershifter
Copy link
Member

layershifter commented Jan 18, 2022

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

@layershifter layershifter changed the title usePopper: allow to define boundaries as functions usePopper: define boundaries with imperative handles Mar 31, 2022
@layershifter
Copy link
Member Author

The issue was updated to propose extending existing imperative handle. With the previous proposal (functions) we cannot handle updates of refs properly.

@miroslavstastny
Copy link
Member

This has been northstar request, currently not blocking anybody.

@msft-fluent-ui-bot
Copy link
Collaborator

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.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Sep 3, 2022
@layershifter layershifter reopened this Sep 5, 2022
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Sep 5, 2022
@msft-fluent-ui-bot
Copy link
Collaborator

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.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Feb 2, 2023
@layershifter layershifter reopened this Feb 2, 2023
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Feb 2, 2023
@msft-fluent-ui-bot
Copy link
Collaborator

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.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Jul 2, 2023
@layershifter layershifter reopened this Jul 4, 2023
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Jul 4, 2023

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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Dec 1, 2023
@layershifter layershifter reopened this Dec 5, 2023
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Dec 5, 2023

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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label May 3, 2024
@layershifter layershifter reopened this May 3, 2024
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants