Skip to content

Commit a076250

Browse files
committed
Fix error TypeError: items[0] is undefined
1 parent d2003aa commit a076250

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addon/src/modifiers/sortable-item.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ export default class SortableItemModifier extends Modifier {
826826
*/
827827
get transitionDuration() {
828828
const items = this.sortableGroup.sortedItems.filter((x) => !x.isDragging && !x.isDropping);
829-
let el = items[0].element ?? this.element; // Fallback when only one element is present in list
829+
let el = items[0]?.element ?? this.element; // Fallback when only one element is present in list
830830
let rule = getComputedStyle(el).transitionDuration;
831831
let match = rule.match(/([\d.]+)([ms]*)/);
832832

0 commit comments

Comments
 (0)