mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 12:26:35 +00:00
Enable auto-scroll for drag and drop (#22725)
This commit is contained in:
parent
a56e22790d
commit
4c898a2a5a
@ -135,6 +135,10 @@ export class HaSortable extends LitElement {
|
|||||||
const Sortable = (await import("../resources/sortable")).default;
|
const Sortable = (await import("../resources/sortable")).default;
|
||||||
|
|
||||||
const options: SortableInstance.Options = {
|
const options: SortableInstance.Options = {
|
||||||
|
scroll: true,
|
||||||
|
// Force the autoscroll fallback because it works better than the native one
|
||||||
|
forceAutoScrollFallback: true,
|
||||||
|
scrollSpeed: 20,
|
||||||
animation: 150,
|
animation: 150,
|
||||||
...this.options,
|
...this.options,
|
||||||
onChoose: this._handleChoose,
|
onChoose: this._handleChoose,
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import type Sortable from "sortablejs";
|
import type Sortable from "sortablejs";
|
||||||
import SortableCore, {
|
import SortableCore, {
|
||||||
OnSpill,
|
|
||||||
AutoScroll,
|
AutoScroll,
|
||||||
|
OnSpill,
|
||||||
} from "sortablejs/modular/sortable.core.esm";
|
} from "sortablejs/modular/sortable.core.esm";
|
||||||
|
|
||||||
SortableCore.mount(OnSpill, new AutoScroll());
|
SortableCore.mount(OnSpill);
|
||||||
|
SortableCore.mount(new AutoScroll());
|
||||||
|
|
||||||
export default SortableCore as typeof Sortable;
|
export default SortableCore as typeof Sortable;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user