On drag, react-beautiful-dnd doesn't show draggable item in material-ui-next.com persistent drawer

On drag, react-beautiful-dnd doesn't show draggable item in material-ui-next.com persistent drawer

react-beautiful-dnd npm
react-beautiful-dnd example code
react-beautiful-dnd horizontal
react-beautiful-dnd hooks
react-beautiful-dnd tree
react-dnd examples
react-beautiful-dnd disable dragging
react-beautiful-dnd board example

I have a persistent drawer which holds a droppable list with draggable items. The functionality is there, but when dragging an item the item that is being dragged is not shown. I can drag the item perfectly and space is being allocated including animations as intended by the dnd framework, I just can't see what I am dragging. If I change the drawer to a permanent drawer, everything works as expected. Any suggestions?

My component (in prototype code): (The DragDropContext is declared in a parent component)

import React from 'react';
import { Divider, Drawer, IconButton, List, ListItem, Paper, 
withStyles } from 'material-ui';
import { Draggable, Droppable } from 'react-beautiful-dnd';

const styles = {
  list: {
    width: 250,
    marginTop: 70
  },
};

const getItemStyle = (isDragging, draggableStyle) => ({
  // some basic styles to make the items look a bit nicer
  userSelect: 'none',
  padding: 8 * 2,
  margin: `0 0 8px 0`,

  // change background colour if dragging
  background: isDragging ? 'lightgreen' : 'red',

  // styles we need to apply on draggables
      ...draggableStyle,

});

const getListStyle = isDraggingOver => ({
  background: isDraggingOver ? 'lightblue' : 'none',
  padding: 8,
  width: 250,
});

class WidgetDrawer extends React.Component {

  state = { items: [{ id: 1, content: 'Widget A'}, { id: 2, content: 'Widget B'}]};

  renderWidgets() {
    const widgets = [{
      name: 'Widget A'
    }, {
      name: 'Widget B'
    }];

    return widgets.map((widget, index) => {
      return <Draggable key={widget.name} draggableId={widget.name} index={index}>
                  {(provided, snapshot) => (
                    <div>
                      <div
                        ref={provided.innerRef}
                        {...provided.draggableProps}
                        {...provided.dragHandleProps}
                        style={getItemStyle(
                          snapshot.isDragging,
                          provided.draggableProps.style
                        )}
                      >
                        <ListItem>
                          <Paper>
                            {widget.name}
                          </Paper>
                        </ListItem>
                      </div>
                      {provided.placeholder}
                    </div>
                  )}
                </Draggable>
    })
  }

  render() {

    const { classes } = this.props;

    const fullList = (
      <div className={classes.list}>
          <Droppable droppableId="droppable">
          {(provided, snapshot) => (
            <div
              ref={provided.innerRef}
              style={getListStyle(snapshot.isDraggingOver)}
            >
              {this.state.items.map((item, index) => (
                <Draggable key={item.id} draggableId={item.id} index {index}>
                  {(provided, snapshot) => (
                    <div>
                      <div
                        ref={provided.innerRef}
                        {...provided.draggableProps}
                        {...provided.dragHandleProps}
                        style={getItemStyle(
                          snapshot.isDragging,
                          provided.draggableProps.style
                        )}
                      >
                        {item.content}
                      </div>
                      {provided.placeholder}
                    </div>
                  )}
                </Draggable>
              ))}
              {provided.placeholder}
            </div>
          )}
        </Droppable>
      </div>
    );

    return (
     <Drawer
       variant='permanent'
       anchor="right"
       open={this.props.open}
       onClose={this.props.toggleDrawer}>
      <div
        tabIndex={0}
        role="button"
        onClick={this.props.toggleDrawer}
        onKeyDown={this.props.toggleDrawer}
      >
        {fullList}
      </div>
    </Drawer>
    )
  }
}

export default withStyles(styles)(WidgetDrawer);

This can be fixed by overriding the provided props in

const getItemStyle = (isDragging, draggableStyle) => ({
  ...draggableStyle,
  userSelect: 'none',
  position:static,
  padding: 8 * 2,
  margin: `0 0 8px 0`,
  background: isDragging ? 'lightgreen' : 'red',    
});

Dragging doesn't end, intermittently · Issue #1662 · atlassian/react , I'm dragging & dropping t Dragging doesn't end, intermittently #1662. Open What version of react-beautiful-dnd are you running? React-Beautiful-DnD is a React package with a goal of creating drag and drop functionality for lists that anyone can use, even people who can't see. The main design goal is physicality - they want users to feel like they are moving objects around by hand. It also has accessibility features, including drag and drop using just the keyboard.


For anyone else struggling with this. It is most likely because there is a transform set on your parent element. Even if it is a zero transform it will mess up transforms on the fixed child. So the only known solution is to remove the transform on the parent (or set it to 'none').

Or you can try messing with react portals for an alternative solution.

https://github.com/atlassian/react-beautiful-dnd/issues/128

Not able to drag elements after implementing beautiful DnD. · Issue , react-beautiful-dnd exists to create beautiful drag and drop for lists that anyone can use - even people who cannot see. For a good overview of  In react-beautiful-dnd there is a separation between what is being dragged (a Draggable), and how a user drags it (a drag handle). This lesson will explain this distinction and show you how you can control what the drag handle is for a Draggable. A ` child function receives a provided object. This object has a property called dragHandleProps.


I was having the same issue when using react-beautiful-dnd in the Material-UI drawer after "transform" the draggable item would disappear.

However, you can prevent this behavior by setting the transform property of the droppable list to none and preventing the inheritance of the transformation from the Drawer or any other transformed element.

<Droppable style={{ transform: "none" }} droppableId="droppable">

react-beautiful-dnd, React-beautiful-dnd is made up of three different components that we can import: DragDropContext, a component, that we use to wrap the part of  React beautiful DND Pros. It works really well for one-dimensional layout (i.e., lists) and if your drag and drop requires either horizontal movement or vertical movement For example, a Trello-like layout and to-do list, etc, will work out of the box with react-beautiful-dnd; The API is a breeze, anyone can easily figure things out.


Drag n'Drop with react-beautiful-dnd - Reinald Reynoso, one reason why render props pattern is used is that react beautiful DND does not need to create any DOM order for us,we have to create our  #Hi @alexreardon , This is the best library for Drag And Drop I have seen till date. It works perfectly for me in chrome. But it doesn&#39;t work in IE. Do I need to add some Polyfill to make it wo


Implementation of Drag & Drop using React Beautiful DND and , Drag and drop (dnd) experiences are often built to sort lists of content vertically and horizontally. react-beautiful-dnd is an excellent tool for these use cases. react-beautiful-dnd exists to create beautiful drag and drop for lists that anyone can use - even people who cannot see. react-beautiful-dnd is a higher level abstraction specifically built for lists (vertical, horizontal, movement between lists, nested lists and so on).


Beautiful and Accessible Drag and Drop with react-beautiful-dnd , react-beautiful-dnd provides a robust API for configuring what can be dragged or dropped where. isDragDisabled prop on a <Draggable /> , isDropDisabled  Auto scrolling a fixed positioned container doesn't work in drag and drop an item to the upper or lower edge of the screen. Can you please check react