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

placement error!!! options.placement set 'top' but replace to 'bottom' #444

Closed
acgblogs opened this issue Apr 27, 2022 · 1 comment
Closed

Comments

@acgblogs
Copy link

<==== my code ====>
const Example = () => {
const [referenceElement, setReferenceElement] = React.useState(null);
const [popperElement, setPopperElement] = React.useState(null);
const { styles, attributes } = usePopper(referenceElement, popperElement, {
placement: 'top'
});

return (
  <>
    <button type="button" ref={setReferenceElement}>
      Reference
    </button>
    {ReactDOM.createPortal(
      <div
        ref={setPopperElement}
        style={styles.popper}
        {...attributes.popper}
      >
        Popper
      </div>,
      document.body
    )}
  </>
);

};

<==== popper render result ===>
image

@acgblogs
Copy link
Author

package version:
"@popperjs/core": "^2.11.5",
"react-popper": "^2.2.5"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant