Skip to content

bogdan2341/react-beautiful-dnd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#@ninternal/react-beautiful-dnd

its a fork from react-beautiful-dnd

Basic usage

Use props to avoid scroll when onDragStart

  • isVerticalAutoScrollDisabled
  • isHorizontalAutoScrollDisabled
import React from 'react';
import { DragDropContext } from '@ninternal/react-beautiful-dnd';

class App extends React.Component {
  onBeforeCapture = () => {
    /*...*/
  };

  onBeforeDragStart = () => {
    /*...*/
  };

  onDragStart = () => {
    /*...*/
  };
  onDragUpdate = () => {
    /*...*/
  };
  onDragEnd = () => {
    // the only one that is required
  };

  render() {
    return (
      <DragDropContext
        onBeforeCapture={this.onBeforeCapture}
        onBeforeDragStart={this.onBeforeDragStart}
        onDragStart={this.onDragStart}
        onDragUpdate={this.onDragUpdate}
        onDragEnd={this.onDragEnd}
        isVerticalAutoScrollDisabled      // <-
        isHorizontalAutoScrollDisabled    // <-
      >
        <div>Hello world</div>
      </DragDropContext>
    );
  }
}

About

Beautiful and accessible drag and drop for lists with React

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%