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

fix(DragDropSort): fix positioning of DragOverlay #10283

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

adamviktora
Copy link
Contributor

@adamviktora adamviktora commented Apr 16, 2024

What: Closes #10090

Change was done based on this comment from the author of the dnd-kit package.

I assume that a div with id="root" will always be present in a React app, which I don't know if it is 100% true.

We should also do this change for V6 once DragDrop is removed from the next folder.

@adamviktora adamviktora requested review from kmcfaul, a team and tlabaj and removed request for a team April 16, 2024 15:18
@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 16, 2024

@adamviktora adamviktora marked this pull request as draft April 16, 2024 15:30
@adamviktora adamviktora marked this pull request as ready for review April 17, 2024 10:02
@@ -159,7 +163,7 @@ export const DragDropSort: React.FunctionComponent<DragDropSortProps> = ({
);
}
})}
<DragOverlay>{activeId && getDragOverlay()}</DragOverlay>
{canUseDOM ? ReactDOM.createPortal(dragOverlay, document.getElementById('root')) : dragOverlay}
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like it might be worth adding a prop to be able to customize the element passed to createPortal, though also may be something to wait and see if anyone mentions any issue with it. Not a blocker for me to keep this as-is, so unless anyone else would want to see that update ☑️

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

lgtm

@tlabaj tlabaj merged commit d8b7bf3 into patternfly:main Apr 26, 2024
13 checks passed
@patternfly-build
Copy link
Contributor

Your changes have been released in:

Thanks for your contribution! 🎉

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.

Bug - DragDropSort - dragged element transform inaccruate when DragDropSort is in DrawerPanelContent
4 participants