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

adding positionOffset prop to <Draggable/> #393

Merged
merged 8 commits into from
Mar 26, 2019

Conversation

tnrich
Copy link
Contributor

@tnrich tnrich commented Mar 8, 2019

Hey @STRML, here is my first pass at allowing initial position to be a string percent. It is essentially using the same code as before but does not modify the defaultPosition prop in any way and instead adds a new initialPosition prop.

I think this is working as is. We should probably add a few more tests to be sure that the drag callbacks that broke last time aren't breaking this time.

connects #391

@tnrich
Copy link
Contributor Author

tnrich commented Mar 8, 2019

Whoops.. I just realized that you wanted the new prop to be called positionOffset I'll change that now from what I had it as initialPosition

@tnrich
Copy link
Contributor Author

tnrich commented Mar 22, 2019

@STRML bump

Copy link
Collaborator

@STRML STRML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff overall, just some code style suggestions to make this simpler.

lib/Draggable.js Outdated Show resolved Hide resolved
lib/utils/domFns.js Outdated Show resolved Hide resolved
lib/utils/domFns.js Outdated Show resolved Hide resolved
lib/utils/domFns.js Outdated Show resolved Hide resolved
@tnrich
Copy link
Contributor Author

tnrich commented Mar 25, 2019

@STRML I've made the changes you requested. Let me know if those check out!

@tnrich
Copy link
Contributor Author

tnrich commented Mar 25, 2019

I was having trouble getting npm install to run without errors (npm v6.9) so I pushed the latest commits without running the precommit hooks (just FYI)

@STRML
Copy link
Collaborator

STRML commented Mar 25, 2019

What were the errors?

@tnrich
Copy link
Contributor Author

tnrich commented Mar 25, 2019

@STRML hmm it just worked with yarn install but was breaking with npm install. I can't reproduce what I was seeing now so I guess just disregard that.

@tnrich
Copy link
Contributor Author

tnrich commented Mar 25, 2019

@STRML merge it?

const translation = getTranslation(controlPos, positionOffset, '');
return translation;
}
export function getTranslation({x, y}: ControlPosition, positionOffset: PositionOffsetControlPosition, unitSuffix: string): string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@STRML STRML merged commit 8212c0e into react-grid-layout:master Mar 26, 2019
@tnrich
Copy link
Contributor Author

tnrich commented Mar 30, 2019

Lemme know when this gets released! Thanks @STRML

@tnrich
Copy link
Contributor Author

tnrich commented Apr 18, 2019

@STRML will you please release a new version with this in it? Thank you :)

@STRML
Copy link
Collaborator

STRML commented Apr 19, 2019

Published as 3.3.0 @tnrich.

@tnrich
Copy link
Contributor Author

tnrich commented Apr 19, 2019 via email

@tnrich tnrich changed the title adding initialPosition prop to <Draggable/> adding positionOffset prop to <Draggable/> May 17, 2019
MaciejCzyzewsk pushed a commit to MaciejCzyzewsk/react-draggable that referenced this pull request Feb 20, 2023
* adding initialPosition prop to <Draggable/>

* changing initialPosition to positionOffset

* fixing missed rename

* Delete pnpm-debug.log

* Delete package-lock.json

* Delete shrinkwrap.yaml

* making requested changes in react-grid-layout/react-draggable#393
ludarkhorse added a commit to ludarkhorse/ReactGrid that referenced this pull request Feb 21, 2023
* adding initialPosition prop to <Draggable/>

* changing initialPosition to positionOffset

* fixing missed rename

* Delete pnpm-debug.log

* Delete package-lock.json

* Delete shrinkwrap.yaml

* making requested changes in react-grid-layout/react-draggable#393
Karasu0888 pushed a commit to Karasu0888/react-draggable that referenced this pull request Sep 12, 2023
* adding initialPosition prop to <Draggable/>

* changing initialPosition to positionOffset

* fixing missed rename

* Delete pnpm-debug.log

* Delete package-lock.json

* Delete shrinkwrap.yaml

* making requested changes in react-grid-layout/react-draggable#393
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