[Drawer] Drawer height changes when placement is "bottom/top"
See original GitHub issueBug report
Describe the bug
With <Drawer placement="bottom" size="md" />
, the drawer height keeps growing as you add more content to DrawerBody
, even though you have specified a md
size.
To reproduce
- Go to https://next.chakra-ui.com/docs/overlay/drawer#drawer-placement
- Choose placement
bottom
- Add lots of content within
DrawerBody
- See the oversized panel
Minimal reproduction
Expected behavior
The Drawer should honor size
and have a max-height
when placement is bottom
or top
, just like it has max-width
when placement is left
or right
Screenshots
System information
- OS: [e.g. macOS, Windows]
- Browser (if applies): [e.g. Chrome, Safari]
- Version of @chakra-ui/core: [e.g. 1.0.0-rc.3]
- Version of Node.js: [e.g. 12.11.1]
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Slidingdrawer position changes while adjust it's height
I have created sliding drawer for my relative layout which includes some buttons. But when I adjust the height of the drawer the...
Read more >Install Drawers Without Metal Slides - Wood Magazine
This method allows for drawers the full height and width of the opening. Because the groove should be at least 3 ⁄ 8...
Read more >How to Adjust Cabinet Drawer Guides & Faces - YouTube
If your cabinet drawer looks crooked or isn't operating smoothly, chances are it just needs some minor adjustments.
Read more >Overview | TMS Diagram Studio documentation
Helper class TBlockDrawer for easy custom drawing on custom blocks;. Lots of ready-to-use TAction descendants available for specific diagram operations:.
Read more >Vantage+Spec+Book+2019+.pdf - Amazon AWS
Throughout this specifications guide, you'll find thousands of ways to ... randomly distress cabinet doors and drawers to mimic the character marks of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ctpaulson,
I solved this using a hook largely inspired from https://usehooks.com/useWindowSize/:
It works pretty well 😉
@binajmen @imdongchen Here’s a workaround I figured out.
You can add a
maxH
attribute to the<DrawerContent>
component, like so:You can use either
vh
units if you want the drawer to take up a certain portion of the viewport height, or hardcode apx
value.