Course Introduction: Beautiful and Accessible Drag and Drop with react-beautiful-dnd
lessonDuration 58s
This is an introduction to the course and outlines what `react-beautiful-dnd` is, and what we will be building together with it
Browse
Find courses, lessons, articles, talks, and podcasts.
45 resources
Showing 1–24 · Page 1 of 2
lessonDuration 58s
This is an introduction to the course and outlines what `react-beautiful-dnd` is, and what we will be building together with it
lessonDuration 3m 14s
`react-beautiful-dnd` enables users with visual impairments to perform drag and drop operations using only a keyboard and screen reader. This lesson will show you how you can customise the preset `react-beautiful-dnd` screen reader messaging to power your own domain-specific messaging as well as internationalisation. We will achieve this by using the `aria-describedby` prop on a *drag handle* as well as the `announce` function which is provided to the `DragDropContext` callback functions
lessonDuration 3m 26s
This lesson will show you how you can use the `<DragDropContext>` `onDragStart` and `onDragEnd` callbacks to add style updates to your application. Using these callbacks will give you fine grain control of the look and feel of your application while dragging content throughout. In this lesson, we will update the text color of our list items as well as set the background color while dragging said item.
lessonDuration 5m 58s
We will look at allowing style updates to Draggable and Droppable components without re-rendering their children. We will do this by creating a new component `<InnerList />` which conditionally block renders with React's `shouldComponentUpdate` lifecycle hook. After this, you'll see how using React's `PureComponent` can be used to achieve the same optimization.
lessonDuration 6m 47s
In this lesson, we will be applying a collection of learned techniques to enable reordering of the columns in our application. To achieve this, you will wrap the Columns in a single `<Droppable /> ` component, ordered on the horizontal plane, and enhance the Columns to become draggable. You’ll see that wiring up Columns for re-ordering is very similar to what you experienced with tasks. We will be using nested `<Draggable />` and `<Droppable />` components and the `Droppable` `type` prop to achieve column reordering.
lessonDuration 2m 36s
In this lesson we will show you how to create `<Droppable />`s that are oriented on the horizontal plane. The `<Droppable />` component provides us with a `direction` prop that we can use to set a list of data to be sortable in the vertical or horizontal plane.
lessonDuration 4m 59s
Now that we are able to drag tasks between our task lists, we might not always want a user to move a task to any location. This lesson will explore how we can conditionally allow what can be dragged, and where it can be dragged to. react-beautiful-dnd provides a robust API for configuring what can be dragged or dropped where. `isDragDisabled` prop on a `<Draggable />`, `isDropDisabled` prop on a `<Droppable />`, and the `<Droppable />` `type` prop give you fine-grain control to allow whatever business logic you need to implement, control what is draggable and droppable.
lessonDuration 5m 48s
In this lesson we will place multiple task lists next to each other and enable movement of the tasks between the lists. Now that our application has multiple columns, the `onDragEnd` callback will need to be refactored to handle more than one column. We will add some new logic to move tasks from one column to another in our state.
lessonDuration 2m 18s
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 `<Draggable />` child function receives a `provided` object. This object has a property called `dragHandleProps`. This property gives us the ability to designate what part of the `<Draggable />` the user interacts with for drag and drop. You’ll see how to pass this prop to a separate React component to designate control.
lessonDuration 4m 22s
`<Draggable />` and `<Droppable />` components provide `snapshot` objects to their child functions. These `snapshot` objects can be used to create beautiful visual queues for users while a drag is occurring.
lessonDuration 5m 34s
In this lesson will demonstrate how you can persist changes locally that resulted from a drag and drop interaction. To accomplish this, you will implement the `onDragEnd` callback function that is invoked at the end of every `react-beautiful-dnd` drag and drop. This function receives a `result` object. We will use the `source` and `destination` properties of the `result` object to update the order of our task list
lessonDuration 8m 12s
In this lesson, we will add `react-beautiful-dnd` to our project to enable reordering of our tasks. In our lesson, we use a styled-components [`innerRef` callback](https://www.styled-components.com/docs/advanced#refs) to get the DOM ref for our styled component. If you have not used ref's in `React` before I recommend you check out: - The [React ref documentation](https://reactjs.org/docs/refs-and-the-dom.html) - This egghead lesson: [Manipulate the DOM with React refs](https://egghead.io/lessons/egghead-manipulate-the-dom-with-react-refs) A small cheatsheet about refs: - On a React Element such as `<div>` the `ref` callback returns a DOM node - On a React Component such as `<Person>` the ref callback returns the instance of the component - which is not what react-beautiful-dnd needs - It is a common practice to create your own `innerRef` callback for your components to return the underlying DOM reference of the component
lessonDuration 7m 37s
In this lesson we will create a task list from scratch together; explaining the various pieces. This lesson will involve creating our state model and visual components to create our task list. We will be using this list in future lessons as a foundation for our drag and drop experience
lessonDuration 1m 21s
In this lesson we will set up a `React` environment using [Create React App](https://github.com/facebook/create-react-app) for use in the remainder of the course
course
Listening to and responding to events is a foundational skill for building software for the web. The Document Object Model, or DOM for short, has a powerful built-in event system. And yet, many of us have a pretty basic understanding of the DOM event system and only scratch the surface of the available power. This lack of understanding leads to bugs in our applications and writing lots of code to work around the DOM event system rather than leveraging it. The goal of the course is that you will walk away with the confidence to successfully and meaningfully engage with the DOM event system. The DOM event visualizer [domevents.dev](https://domevents.dev) will be used to explain many behaviors throughout the course. You are welcome to play with the visualizer yourself to continue your learning
lessonDuration 1m 5sFree
This is a light introduction to the DOM events problem space and overview of the major topics that we will be covering. I will also introduce people to https://domevents.dev
lessonDuration 6m 24s
Two separate `event` object methods exist for stopping an event: `event.stopPropagation()` and `event.stopImmediatePropagation()`. This lesson will explain the differences between these two functions as well as cautioning you about some dangers in stopping events.
lessonDuration 1m 16s
In this lesson, we'll look at how some browsers treat some events added to the `body` as passive by default. However, HTML attribute event handlers on the `body` do not share these default passive values.
lessonDuration 3m 13s
Explaining what an `event` is, how they are dispatched to `EventTargets`, and you can respond to those events by adding **event listeners**. This lesson also covers how events move through `EventTarget`'s that participate in a tree (such as elements in the DOM): a ↓ capture phase, ◎ target phase and an optional ↑ bubble phase
lessonDuration 5m 58s
`removeEventListener` removes an event listener added with `addEventListener`. However, there are a number of gotchas to watch out for in order to correctly remove an event listener.
lessonDuration 3m 47s
Using HTML attributes event handlers and object property event handlers are related ways of expressing a single event listener binding to an element. This lesson explores the dynamics and often strangeness of that relationship.
lessonDuration 4m 19s
In this lesson we we will look at how you can inspect and debug event listeners in your browser by using the browser developer tools.
lessonDuration 6m 56s
This lesson will explore what problem passive event listeners are trying to solve, and how you can mark your event listeners as passive to improve scrolling performance. It also covers how some browsers automatically set `touchstart`, `touchmove`, `wheel` and `mousewheel` events added to the `window`, `document` or `body` as passive by default.
lessonDuration 5m 48s
Event delegation is a simple, but powerful leveraging of the DOM event system which allows for easier adding of functionality to dynamically created content; as well as being an interesting performance optimization.