react-rnd icon indicating copy to clipboard operation
react-rnd copied to clipboard

FIX: #454

Open chathuraa opened this issue 7 years ago • 7 comments

Component change the Y position when Drag stops even though dragging is restricted to X axis

chathuraa avatar Oct 03 '18 11:10 chathuraa

@chathuraa Thanks for your great work :) Looks good. I'd like to ask you one more favor, could you please add reproduced case to storybook.

https://codesandbox.io/s/j1vj3j90ov

bokuweb avatar Oct 03 '18 23:10 bokuweb

Sure thing, I'll give it a go, this will be my 1st story book. :).

On Thu, 4 Oct. 2018, 9:54 am bokuweb, [email protected] wrote:

@chathuraa https://github.com/chathuraa Thanks for your great work :) Looks good. I'd like to ask you one more favor, could you please add reproduced case to storybook.

https://codesandbox.io/s/j1vj3j90ov

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bokuweb/react-rnd/pull/455#issuecomment-426841009, or mute the thread https://github.com/notifications/unsubscribe-auth/ACTfwd6xhn2mJzDjFtnyR-VMKK2VxYltks5uhU5GgaJpZM4XF0gA .

chathuraa avatar Oct 04 '18 00:10 chathuraa

Yep will do.

On Thu, 4 Oct. 2018, 3:43 pm bokuweb, [email protected] wrote:

@bokuweb requested changes on this pull request.

In src/index.tsx https://github.com/bokuweb/react-rnd/pull/455#discussion_r222543143:

@@ -497,10 +497,32 @@ export class Rnd extends React.Component<Props, State> { const { left, top } = this.getOffsetFromParent(); let draggablePosition; if (position) {

@chathuraa https://github.com/chathuraa Sorry, could you please separate these block to another function or method like createNewPosition 🙏

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bokuweb/react-rnd/pull/455#pullrequestreview-161453604, or mute the thread https://github.com/notifications/unsubscribe-auth/ACTfwSK9NAHsBlHFRs_roGAcB9K0Cd84ks5uhZ_5gaJpZM4XF0gA .

chathuraa avatar Oct 04 '18 07:10 chathuraa

It seems to be. Cause of the issue is adding/subtracting left and top. And getoffset.... is dependency for most of the other methods.

Adding and subtracting should be based on each scenario, I can't figure out the relationship between the uncontrolled bounds and getoffset....

Thanks

On Mon, 8 Oct. 2018, 11:09 am bokuweb, [email protected] wrote:

@bokuweb commented on this pull request.

In src/index.tsx https://github.com/bokuweb/react-rnd/pull/455#discussion_r223233910:

@@ -497,10 +497,32 @@ export class Rnd extends React.Component<Props, State> { const { left, top } = this.getOffsetFromParent(); let draggablePosition; if (position) {

Hmmmm, I'll try to fix it 🙏 So, this issue is complex....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bokuweb/react-rnd/pull/455#discussion_r223233910, or mute the thread https://github.com/notifications/unsubscribe-auth/ACTfwbUufhjvx6YVne2CRuVvEkF_Tzmcks5uipedgaJpZM4XF0gA .

chathuraa avatar Oct 08 '18 06:10 chathuraa

Any chance to get this PR mergered? Experiencing same issues

jakub-chatrny avatar Nov 28 '19 16:11 jakub-chatrny

For enyone facing same issue, there is workaround. Just set vertical grid strep to some ridiculous value like dragGrid={[stepWidth, 10000]}

note: when I did set grid vertical value to 0 while using controlled state. Drag start behave really wierdly.

jakub-chatrny avatar Dec 04 '19 13:12 jakub-chatrny

Hello?

FullstackJack avatar Apr 09 '23 02:04 FullstackJack