fix(react-draggable-dialog): sync internal dropPosition with external position prop#623
Conversation
dmytrokirpa
left a comment
There was a problem hiding this comment.
Thanks for the PR, but it needs some changes
|
@themechbro Could you please update failing tests and run thank you! |
|
pls provide further instruction - quite bigh spark, fork generated from code |
Updated to use onDragStart, reverted the unrelated chat types, and updated the hook tests to match! |
… position prop (fixes microsoft#606)
4869d90 to
9abead2
Compare
Thank you, @themechbro! But I think you missed this part:
So you might need to:
Also, please make sure to update the PR description so someone form @microsoft/teams-prg could review it |
Summary
This PR fixes a bug where the
DraggableDialogwould jump or teleport if thepositionprop was updated externally.Changes
useEffectwithonDragStartto properly synchronize the internaldropPositionwith the externalpositionprop at the moment dragging begins.react-chatpackage types.useDraggableDialog.test.tsto include the new onDragStart return value.Testing
Fixes #606
cc: @microsoft/teams-prg