atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
33.29k stars 2.53k forks source link

Add inline-css Make dragging doesnot work #2383

Open yiman58 opened 2 years ago

yiman58 commented 2 years ago

If I remove the styles comment, drag will not work,and console has no error

"react": "^16.6.0", "react-beautiful-dnd": "10.1.1",

{ (provided, snapshot) => (
{this.props.task.content}
) }
syntaxerron commented 1 year ago

I am also having the same issue, I tried adding a background color using inline styling. It works with tailwind CSS but I also wanted to apply dynamic styling with my background using RGBA:

<Draggable
        draggableId={draggableId}
        index={index}
        isDragDisabled={!category.draggable}
      >
        {(providedCategory) => (
          <div
            ref={providedCategory.innerRef}
            {...providedCategory.draggableProps}
            {...providedCategory.dragHandleProps}
            className={`flex w-[${categoryWidth}px] min-w-[${categoryWidth}px] flex-col gap-3 rounded-xl p-3 shadow-md`}
            style={{
              backgroundColor: category?.color
                ? hexToRGBA(category?.color, 0.1)
                : '#f3f4f6',
            }}
          >
               // Rest of code here
    </div>
    )}
</Draggable>

It can still be dropped but the visual way of dragging the container does not work.