Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic authored Jul 22, 2021
1 parent 6acd046 commit ed6a6c6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .changeset/measuring-configuration-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
"@dnd-kit/core": major
---

The `layoutMeasuring` prop of `DndContext` has been renamed to `measuring`.

The options that could previously be passed to the `layoutMeasuring` prop now need to be passed as:
```diff
<DndContext
- layoutMeasuring={options}
+ measuring={{
+ droppable: options
+ }}
```

The `LayoutMeasuring` type has been renamed to `MeasuringConfiguration`. The `LayoutMeasuringStrategy` and `LayoutMeasuringFrequency` enums have also been renamed to `MeasuringStrategy` and `MeasuringFrequency`.

This refactor allows consumers to configure how to measure both droppable and draggable nodes. By default, `@dnd-kit` ignores transforms when measuring draggable nodes. This beahviour can now be configured:

```tsx
import {
DndContext,
getBoundingClientRect,
MeasuringConfiguration,
} from '@dnd-kit/core';

const measuringConfig: MeasuringConfiguration = {
draggable: {
measure: getBoundingClientRect,
},
};

function App() {
return <DndContext measuring={measuringConfig} />
}
```

0 comments on commit ed6a6c6

Please sign in to comment.