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

Fixes #494 Add optional abort for onResizeStart #495

Merged
merged 1 commit into from Aug 12, 2019

Conversation

Samuel-Lewis
Copy link
Contributor

@Samuel-Lewis Samuel-Lewis commented Aug 1, 2019

Add optional return boolean when calling onResizeStart to early exit and abort the resize sequence

Proposed solution

(From ticket #494)
Currently, when onResizeStart is called, the user provided onResizeStart (from props) is also called. In certain scenarios, however, some condition may be hit where the user wants to abort the resize.

The feature request would be to allow the user to return a boolean from their defined onResizeStart, and if it returns false, the re-resizable's onResizeStart would have an early exit and not cause any resizing.

Tradeoffs

Should not add any overheard or tradeoffs. This onResizeStart is only stopped if the user returns an explicit false. I'm sure there are many cases where the return is undefined, which should be unaffected by this change.

Testing Done

Confirmed locally in project. Added a test that initiates a resize, but immediately aborts. While the 'user' continues to resize, it checks the state isResizing state of the Resizable (should be false).

@Samuel-Lewis
Copy link
Contributor Author

@bokuweb I'm not sure why the build failed. Could you possibly rerun it?

@bokuweb
Copy link
Owner

bokuweb commented Aug 12, 2019

@Samuel-Lewis Sorry I missed it. I'll check it later.

@bokuweb bokuweb merged commit ffff47f into bokuweb:master Aug 12, 2019
@bokuweb
Copy link
Owner

bokuweb commented Aug 12, 2019

@Samuel-Lewis LGTM

@bokuweb
Copy link
Owner

bokuweb commented Aug 12, 2019

@Samuel-Lewis Please try v6.0.0 :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants