Caleb Porzio il y a 1 an
Parent
commit
628b5a927c
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      packages/ui/src/list-context.js

+ 3 - 3
packages/ui/src/list-context.js

@@ -38,10 +38,10 @@ export function generateContext(Alpine, multiple, orientation, activateSelectedO
             if (this.unregisterKeysQueue.length === 0) {
                 queueMicrotask(() => {
                     if (this.unregisterKeysQueue.length > 0) {
-                        this.unregisterKeysQueue = []
+                        this.items = this.items.filter(i => ! this.unregisterKeysQueue.includes(i.key))
+                        this.orderedKeys = this.orderedKeys.filter(i => ! this.unregisterKeysQueue.includes(i))
 
-                        this.items = this.items.filter(i => i.key === key)
-                        this.orderedKeys = this.orderedKeys.filter(i => i === key)
+                        this.unregisterKeysQueue = []
 
                         this.reorderKeys()
                         this.activateSelectedOrFirst()