---
title: "shouldCollapseAutoExpandedItems(forDeposited:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsoutlineview/shouldcollapseautoexpandeditems(fordeposited:)"
---

# shouldCollapseAutoExpandedItems(forDeposited:)

Returns a Boolean value that indicates whether auto-expanded items should return to their original collapsed state.

## Declaration

```swift
func shouldCollapseAutoExpandedItems(forDeposited deposited: Bool) -> Bool
```

## Parameters

- `deposited`: If doc://com.apple.documentation/documentation/Swift/true, the drop terminated successfully; if doc://com.apple.documentation/documentation/Swift/false the drop failed.

## Return Value

Return Value true if auto-expanded items should return to their original collapsed state; otherwise false.

## Discussion

Discussion Override this method to provide custom behavior. If the target of a drop is not auto-expanded (by hovering long enough) the drop target still gets expanded after a successful drop unless this method returns true. The default implementation returns false after a successful drop. This method is called in a variety of situations. For example, it is called shortly after the outlineView(_:acceptDrop:item:childIndex:) method is called and also if the drag exits the outline view (exiting the view is treated the same as a failed drop). The return value of the outlineView(_:acceptDrop:item:childIndex:) method determines the incoming value of the deposited parameter.

## See Also

### Supporting Drag and Drop

- [setDropItem(_:dropChildIndex:)](appkit/nsoutlineview/setdropitem(_:dropchildindex:).md)
