maxWidth and maxHeight props don't respect after resize
See original GitHub issueOverview of the problem
I’m using react-rnd 7.1.3 https://www.webpackbin.com/bins/-Kut-6Jbwje1eyPBYBQN
My browser is: Chrome 61.0.3163.100 on Windows 10
I am sure this issue is not a duplicate
Description
When you resize component, maxWidth and maxHeight props are replaced with internal calculations
My use case:
I’m building a component which have button “maximize”

When user click it, I change width and height to 100%. So if user doesn’t resize this window, it works fine, but if user resizes it, maxWidth and maxHeight styles are replaced by internal calculated and after “maximize” window can’t fit all screen, because maxWidth and maxHeight are not 100%
Steps to Reproduce
- Set
maxWidthandmaxHeightprops to100% - Resize component
- Check these styles
- Drag around and resize again
- Check these styles
Expected behavior
After resize end maxWidth and maxHeight are taken from props
Actual behavior
After resize end maxWidth and maxHeight are remain calculated
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Maintain aspect ratio of image with full width in React Native
Using 'contain' with resizeMode: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image...
Read more >react-rnd: A resizable and draggable component for ... - Gitee
A resizable and draggable component for React. ... v7.1.4. Fixed a issue #188 maxWidth and maxHeight props don't respect after resize ...
Read more >Untitled
This allows you to, for example, get the correct drag / resize deltas while you ... #188 maxWidth and maxHeight props don't respect...
Read more >How to fix explicit width & height error in Next.js v10 Image ...
... v10 doesn't respect any height, width, maxwidth, maxheight styles. ... explicit height & width or layout="fill" prop, the following ...
Read more >max-width - CSS: Cascading Style Sheets - MDN Web Docs
Ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase...
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 Free
Top 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

But I need to have
bounds… It’s possible to takemaxWidthfrompropsafter resize stop event? Like “ok you shouldn’t resize more thatboundselement size when you resize”, but after resize stop, we don’t need to keep this calculatedmaxWidth, it doesn’t affect anything. Or it can be calculated withdragtooThanks! 🍺