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

[Popover] Does not reposition when updated #18375

Closed
veronicaerick opened this issue Nov 14, 2019 · 5 comments
Closed

[Popover] Does not reposition when updated #18375

veronicaerick opened this issue Nov 14, 2019 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@veronicaerick
Copy link

How can I fix the position of a dropdown menu when used with a multi select when the input display of selected chips grows to x number of rows to the bottom of the input container?

I would like the dropdown menu to always show below the input underline regardless of number of selections. When in a default state with no selections, using MenuProps with the select and setting anchorOrigin + transformOrigin along with setting getContentAnchorEl to null per the docs works very well. The issue occurs when I add more than 2 options to the selected list thats displayed in the input: the menu is statically set at the initial anchor position and doesn't allow for users to view the input/selected chips as the input grows in height as more and more options are selected/shown in the input.

How can I enable the menu to stay attached to the intended position at the bottom of the input when its more than one line in height?

Here is a demonstration of the effect https://codesandbox.io/s/material-demo-yr3en?fontsize=14&hidenavigation=1&theme=dark

Example:
Screen Shot 2019-11-14 at 11 49 42 AM

@oliviertassinari oliviertassinari added the component: Popover The React component. label Nov 14, 2019
@oliviertassinari
Copy link
Member

@veronicaerick This thread sounds like the Popover variant of the Popper discussion in #18310.
It also sounds related to #18136.

@oliviertassinari
Copy link
Member

I would like the dropdown menu to always show below the input underline regardless of number of selections.

The solution is in #18136 (comment).

<Select
  MenuProps={{
    getContentAnchorEl: null,
    anchorOrigin: {
      vertical: 'bottom',
      horizontal: 'center',
    },
    transformOrigin: {
      vertical: 'top',
      horizontal: 'center',
    },
  }}
>

@veronicaerick
Copy link
Author

Hey thanks for the response.. I have that exact configuration in the codesandbox (https://codesandbox.io/s/material-demo-yr3en?fontsize=14&hidenavigation=1&theme=dark) - the issue is when more than one row of selections is present, the above doesn't work and results in

Screen Shot 2019-11-16 at 9 19 51 AM

@oliviertassinari oliviertassinari changed the title Multi Select with MenuProps anchor origin positioning fails when input display wraps to new line [Popover] Does not reposition when updated Nov 16, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 16, 2019

Same as #18310.

@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed component: Popover The React component. labels Nov 30, 2019
@oliviertassinari
Copy link
Member

I'm closing as a duplicate of #10595.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants