diff --git a/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-group.ts b/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-group.ts index 9460dfe91a..23ff6e433a 100644 --- a/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-group.ts +++ b/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-group.ts @@ -1,5 +1,5 @@ import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; -import { css, html, customElement, LitElement, repeat, property, state } from '@umbraco-cms/backoffice/external/lit'; +import { css, html, customElement, LitElement, repeat, property } from '@umbraco-cms/backoffice/external/lit'; import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api'; import { UmbSorterConfig, UmbSorterController } from '@umbraco-cms/backoffice/sorter'; diff --git a/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-item.ts b/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-item.ts index 38ad5d12d1..495370bb00 100644 --- a/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-item.ts +++ b/src/Umbraco.Web.UI.Client/examples/sorter-with-two-containers/sorter-item.ts @@ -14,7 +14,7 @@ export class ExampleSorterItem extends UmbElementMixin(LitElement) { render() { return html` ${this.name} - + `; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts b/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts index d159bf7f9f..e6ea2ff7e0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts @@ -212,7 +212,7 @@ export class UmbSorterController { if (child.matches && child.matches(this.#config.itemSelector)) { - this.setupItem(child as HTMLElement); + this.setupItem(child as ElementType); } }); this.#observer.observe(containerElement, { @@ -230,7 +230,7 @@ export class UmbSorterController { + console.log('#drag start!'); + if (this.#currentElement) { this.#handleDragEnd(); } @@ -302,26 +329,23 @@ export class UmbSorterController { - // It should be okay to use the same rqaId, as the move does not or is okay not to happen on first frame/drag-move. + // It should be okay to use the same rqaId, as the move does not, or is okay not, to happen on first frame/drag-move. this.#rqaId = undefined; if (this.#currentElement) { this.#currentElement.style.transform = ''; - if (this.#config.placeholderClass) { - this.#currentElement.classList.add(this.#config.placeholderClass); - } - if (this.#config.placeholderAttr) { - this.#currentElement.setAttribute(this.#config.placeholderAttr, ''); - } + this.#setupPlaceholderStyle(); } }); }; #handleDragEnd = async () => { + console.log('#drag end!'); if (!this.#currentElement || !this.#currentItem) { return; } @@ -329,12 +353,7 @@ export class UmbSorterController