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

Support for vw, vh unit for maxWidth, maxHeight #525

Closed
hhvys opened this issue Sep 23, 2019 · 3 comments · Fixed by #526
Closed

Support for vw, vh unit for maxWidth, maxHeight #525

hhvys opened this issue Sep 23, 2019 · 3 comments · Fixed by #526

Comments

@hhvys
Copy link

hhvys commented Sep 23, 2019

Overview of the problem

I'm using re-resizable 6.0.0

My browser is: Chrome

I am sure this issue is not a duplicate? Not sure

Description

re-resizable currently supports defaultSize property related to the viewport, it will be helpful if maxWidth and maxHeight can also be assigned relative to viewport.e.g. maxHeight="90vw"

Steps to Reproduce

Please refer the link below

https://codesandbox.io/s/admiring-violet-tqi45

Expected behavior

component should not resize when the width of component is more than 90% of the viewport.

Actual behavior

maxHeight ending with % is being handled currently. but when it ends with vw or vh it breaks

@hhvys
Copy link
Author

hhvys commented Sep 23, 2019

I have got an overview of the code and it seems there isn't any handling for viewport unit(vw, vh) for maxHeight/maxWidth. Please let me know if it is not intentional or I am missing something.

Also, if not intentional, can I fix this?

@bokuweb
Copy link
Owner

bokuweb commented Sep 24, 2019

@hhvys Tanks for your report. I know however I don't have enough time to fix it.
If you are ok please create PR 👍

@hhvys
Copy link
Author

hhvys commented Sep 24, 2019

Taking it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants