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

how to get rowHeight ? #55

Open
sibelius opened this issue Sep 4, 2018 · 1 comment
Open

how to get rowHeight ? #55

sibelius opened this issue Sep 4, 2018 · 1 comment

Comments

@sibelius
Copy link

sibelius commented Sep 4, 2018

I'd like to adapt the menu height based on the number of rows and also based on the screen size

is this possible?

@techniq
Copy link
Owner

techniq commented Sep 5, 2018

Currently due to using react-virtualized the height has to be known (to enable windowing), either as an explicit pixel height passed to menuHeight, or derived pixel height from the number of menu items. If we drop react-virtualized (#54) you should be able to leverage CSS (use 100vh, etc), but until then it has to be one of the two.

One workaround you might try is using a measurement component to pass the explicit container height. I used to do this with mui-table when it also used react-virtualized. I would use vx's ParentSize and a wrapping component. Something like this (untested, but should lead you in the right direction).

<div style={{ height: 'calc(100vh - 64px)' }}>
  <ParentSize>
    {({ height }) => (
      <MuiDownshift menuHeight={height} ... />
    )}
  </ParentSize>
</div>

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

2 participants