React-beautiful-dnd在简单列表上不起作用

时间:2020-05-10 16:26:05

标签: react-beautiful-dnd

我正在尝试使用react-beautiful-dnd。我已经按照文档进行操作,没有错误弹出。但是我的名单是不可拖放的。这是我的代码

<Scrollbars className="comments-slider">
                        <DragDropContext onDragEnd={this.onDragEnd}>
                            <Droppable droppableId={this.props.collections_reducer.selected_collection.id}>
                                {(provided)=>(
                                    <div
                                        {...provided.droppableProps}
                                        ref={provided.innerRef}
                                    >
                                        {this.props.collection_edl_reducer.collection_edl_tag_list && this.props.collection_edl_reducer.collection_edl_tag_list.map((tag, i)=>{
                                            return <Draggable
                                                key={tag.id}
                                                draggableId={tag.id}
                                                index={tag.index}
                                            >
                                                {(provided)=>(
                                                    <div
                                                        ref={provided.innerRef}
                                                        {...provided.draggableProps}
                                                        {...provided.dragHandleProps}
                                                    >
                                                        <CollectionEDLTag
                                                            key={tag.id}
                                                            id={tag.id}
                                                            tag={tag}
                                                            //selectedFrameTag={this.state.selected_frame_tag}
                                                            //setSelectedFrameTag={(tag)=>this.setSelectedFrameTag(tag)}
                                                            //selectedAssetVersion={this.props.selectedAssetVersion}
                                                        />
                                                    </div>

                                                )}
                                            </Draggable>
                                        })}
                                        {provided.placeholder}
                                    </div>
                                    )}
                            </Droppable>

                        </DragDropContext>



                    </Scrollbars>

我在做什么错

0 个答案:

没有答案