-
Notifications
You must be signed in to change notification settings - Fork 370
feat: Vertical and horizontal resize handles supported #76
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
feat: Vertical and horizontal resize handles supported #76
Conversation
This should be soooo useful. @STRML any chance you can look at this ? |
@STRML Are you still maintaining this project? I would like to create a similar PR that adds handlers to all 4 corners but am a little nervous that the effort would be wasted since this PR never got merged or a response. |
143c216
to
449c0dc
Compare
@STRML Thanks. I've rebase my PR to master, but actually it have no independent example or test, because all origin examples will have this feature by default. Should I add an extra props like |
Yes that would be good, as this would otherwise be a change for all users. We want this to be opt-in not opt-out as not to cause breakage. |
+ feat: support horizontal resize handles + feat: add `resizer` props to show resizer handlers
449c0dc
to
48556a2
Compare
I've add an extra prop
|
This is great! However, I am wondering if it would make more sense for the
This would be a bit more future-proof and would allow extending to support handles on the top and left sides, e.g.:
In this case the
The support for other handles may be out of scope for this PR (I'd be happy to pick this up once this get merged), but updating the Thoughts? |
I don't mind it. Any prior art in other libs you can find for this? The
strings feel a bit messy but not horrible.
…On Thu, Jan 10, 2019, 9:23 PM Rocco Cataldo ***@***.*** wrote:
This is great! However, I am wondering if it would make more sense for the
resizer prop type to be a bit more specific, e.g.:
- 'r': show right resize handle.
- 'b': show bottom resize handle.
- 'br': show bottom-right resize handle.
This would be a bit more future-proof and would allow extending to support
handles on the top and left sides, e.g.:
- 'l': show left resize handle.
- 't': show top resize handle.
- 'tl': show top-left-right resize handle.
- 'bl': show bottom-left resize handle.
- 'tr': show to-right resize handle.
In this case the resizer prop could accept an array to allow any
combination of handles:
// show right, bottom, and bottom-right handles
<Resizable resizer={['r', 'b', 'br']} />
// show bottom-right handle only (default)
<Resizable resizer={['br']} />
// show handles on each corner
<Resizable resizer={['tl', 'tr', 'bl', 'br']} />
Thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#76 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJFPz42r4cnMWM92K86InSoRZ1edc8Wks5vCAOigaJpZM4PSjQH>
.
|
Just did a quick search and found re-resizable, which follows a similar pattern:
react-resizable-component supports this as well, but uses cardinal directions ( |
I prefer (s, w, e, n, sw, nw, se, ne)... |
Works for me! Will you be updating your PR, or shall I submit one? |
@RaoHai any chance you could go forward with this PR ? There are conflicts. |
thanks @RoccoC |
see #101 |
resizer
to restricts resize handlesboth
, show right-bottom resize handle.x
: only show right resize handle.y
: only show bottom resize handle.all
: show all (right, bottom, and bottom-right corner) resize handlers.none
: never show resize handle.ResizeCallbackData
add an extra paramaxis
, shows which direction that user now resize in.