Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Unable to make droppablezone work #9

Open
andeersg opened this issue May 29, 2018 · 0 comments
Open

Unable to make droppablezone work #9

andeersg opened this issue May 29, 2018 · 0 comments

Comments

@andeersg
Copy link

Hi,
So cool that you are porting this library.

I have a problem with making the elements droppable in droppablezones.

This is a modified version of your example:

render() {
    return (
      <div className="App">
        <div className="App-body">
          <DraggableContainer
            as="div"
            type="droppable"
            className="BlockGenerator"
            droppable="drag__drop"
            draggable="drag__element"
          >
            {Array.from(Array(this.state.blockCount).keys()).map(number => (
              <DraggableItem
                as="div"
                className="drag__element"
                style={{ backgroundColor: randomColor() }}
              >
                {number}
              </DraggableItem>
            ))}

            <DroppableZone />
            <DroppableZone />
            <DroppableZone />
            <DroppableZone />

          </DraggableContainer>
        </div>
      </div>
    );
  }

Shouldn't this make the elements droppable in the droppablezones? Or am I missing something? When type="droppable" the elements will not be dragged around, but I see they get a class draggable--original. When I change type to draggable I can move them around, but not drop them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant