@@ -3,7 +3,7 @@ import Sortable from "sortablejs";
33import { debounce } from "es-toolkit" ;
44import { PropertyValues } from "lit" ;
55import { createEvent , h , JsxNode , LitElement , method , property , state } from "@arcgis/lumina" ;
6- import { getRootNode , slotChangeHasAssignedElement } from "../../utils/dom" ;
6+ import { getRootNode , slotChangeHasAssignedElement , slotChangeHasContent } from "../../utils/dom" ;
77import { createObserver } from "../../utils/observers" ;
88import { InteractionMode , Scale , SelectionMode } from "../interfaces" ;
99import { ItemData } from "../list-item/interfaces" ;
@@ -122,7 +122,7 @@ export class List extends LitElement implements SortableComponent {
122122 }
123123
124124 get showEmptyDragContainer ( ) : boolean {
125- return this . dragEnabled && ! this . visibleItems . length ;
125+ return this . dragEnabled && ! this . hasContent ;
126126 }
127127
128128 get showNoResultsContainer ( ) : boolean {
@@ -161,6 +161,8 @@ export class List extends LitElement implements SortableComponent {
161161
162162 @state ( ) sortHandleMenuItems : SortMenuItem [ ] = [ ] ;
163163
164+ @state ( ) hasContent = false ;
165+
164166 //#endregion
165167
166168 //#region Public Properties
@@ -729,10 +731,11 @@ export class List extends LitElement implements SortableComponent {
729731 this . parentListEl = this . el . parentElement ?. closest ( listSelector ) ;
730732 }
731733
732- private handleDefaultSlotChange ( ) : void {
734+ private handleDefaultSlotChange ( event : Event ) : void {
733735 if ( this . parentListEl ) {
734736 this . calciteInternalListDefaultSlotChange . emit ( ) ;
735737 }
738+ this . hasContent = slotChangeHasContent ( event ) ;
736739 }
737740
738741 private setListItemGroups ( ) : void {
@@ -1257,11 +1260,11 @@ export class List extends LitElement implements SortableComponent {
12571260 < div
12581261 class = { {
12591262 [ CSS . tableContainer ] : true ,
1260- [ CSS . tableContainerDropZone ] : this . showEmptyDragContainer ,
1263+ [ CSS . tableContainerDragEnabledEmpty ] : this . showEmptyDragContainer ,
12611264 } }
12621265 role = "rowgroup"
12631266 >
1264- < slot hidden = { ! this . showEmptyDragContainer } name = { SLOTS . dragEmpty } />
1267+ < slot hidden = { ! this . showEmptyDragContainer } name = { SLOTS . dragEnabledEmpty } />
12651268 < slot onSlotChange = { this . handleDefaultSlotChange } ref = { this . setDefaultSlotEl } />
12661269 </ div >
12671270 </ div >
0 commit comments