Draggable/Sortable's plugins/sensors/modifiers options should be able to extend manager's configuration, rather than always overriding
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 924
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
## Current Behavior
`Draggable` and `Sortable`'s sensors/modifiers options are typed as a plain array. Passing these options replaces the parent configurations entirely, rather than extending them.
#1966 adds `Customizable` support to `Sortable`'s `plugins` option, allowing users to extend **default** configurations. But if there are also customizations at the manager level, they will be overriden.
## Expected Behavior
Based on existing `Customizable` type, implement a hierarchical inheritance ability.
Hierarchy:
```
Defaults → Manager Customizations → Draggable/Sortable Customizations
```
**Example**
```ts
const manager = new DragDropManager({
plugins: (defaults) => [...defaults, ManagerPlugin],
});
const draggable = new Draggable({
id: 'draggable-1',
element,
}, manager);
// Results
// plugins: [...defaults, ManagerPlugin]
const customizedDraggable = new Draggable({
id: 'draggable-2,
element,
plugins: (defaults) => [...defaults, DraggablePlugin],
}, manager);
// Results
// plugins: [...defaults, ManagerPlugin, DraggablePlugin]
```
Contributor guide
Assessment
This issue has not been assessed yet.