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

Misleading Popover getContentAnchorEl warning when using typescript. #12539

Closed
duvet86 opened this issue Aug 15, 2018 · 4 comments
Closed

Misleading Popover getContentAnchorEl warning when using typescript. #12539

duvet86 opened this issue Aug 15, 2018 · 4 comments
Labels
good first issue Great for first contributions. Enable to learn the contribution process. typescript

Comments

@duvet86
Copy link
Contributor

duvet86 commented Aug 15, 2018

The warning says:
"Warning: Material-UI: you can not change the default anchorOrigin.vertical value
when also providing the getContentAnchorEl property to the popover component.
Only use one of the two properties.
Set getContentAnchorEl to null or leave anchorOrigin.vertical unchanged."

But the typescript definition doesn't accept null:
getContentAnchorEl?: (element: HTMLElement) => HTMLElement;

I suggest to update the prop definition to accept null values.
getContentAnchorEl?: null | ((element: HTMLElement) => HTMLElement);

It is working fine when set to undefined.

Tech Version
Material-UI-core v1.5.0
React
browser
etc.
@oliviertassinari oliviertassinari added typescript good first issue Great for first contributions. Enable to learn the contribution process. labels Aug 15, 2018
@oliviertassinari
Copy link
Member

@duvet86 Well spotted, do you want to work on it? :)

@duvet86
Copy link
Contributor Author

duvet86 commented Aug 15, 2018

Definitely. I'll submit a pull request tomorrow.
Cheers.

@duvet86
Copy link
Contributor Author

duvet86 commented Aug 17, 2018

Pull request added: #12562

@sudarshan-mane
Copy link

sudarshan-mane commented Jul 12, 2020

@duvet86 Hey HI ,Please help me My dropdown menu position is bottom right of my page instead of bottom right of menu button, can you please help and provide correct code..

<Menu
      anchorBuyer={anchorBuyer}
      anchorOrigin={{ vertical: "top", horizontal: "right" }}
      transformOrigin={{ vertical: "top", horizontal: "right" }}
      id={menuIdBuyer}
      keepMounted
      open={isMenuBuyerOpen}
      onClose={handleMenuCloseBuyer}
    >`
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Great for first contributions. Enable to learn the contribution process. typescript
Projects
None yet
Development

No branches or pull requests

3 participants