From 33fa4e66e8b012b332c537c98c734b88d6eec85d Mon Sep 17 00:00:00 2001 From: Boaz Shuster Date: Mon, 6 Dec 2021 12:02:07 +0200 Subject: [PATCH] fix(DragDrop): don't overwrite children class with Droppable class Signed-off-by: Boaz Shuster --- packages/react-core/src/components/DragDrop/Droppable.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-core/src/components/DragDrop/Droppable.tsx b/packages/react-core/src/components/DragDrop/Droppable.tsx index 1afc45f7fd0..aaf1032a810 100644 --- a/packages/react-core/src/components/DragDrop/Droppable.tsx +++ b/packages/react-core/src/components/DragDrop/Droppable.tsx @@ -27,7 +27,11 @@ export const Droppable: React.FunctionComponent = ({ const childProps = { 'data-pf-droppable': zone, 'data-pf-droppableid': droppableId, - className: css(styles.droppable, className), + // if has no wrapper is set, don't overwrite children className with the className prop + className: + hasNoWrapper && React.Children.count(children) === 1 + ? css(styles.droppable, className, (children as React.ReactElement).props.className) + : css(styles.droppable, className), ...props };