def perform_drag_mode_exit_setups(self):
        """Perform actions to conclude the dragging action."""
        ### reference the dragged object and its center y
        ### coordinate locally

        dragged_obj = self.dragged_obj
        _, centery = dragged_obj.rect.center

        ### pick a reference to list nearest to where the
        ### dragged object was dropped

        collection = (
            ## if the obj was above the bottom of the items
            ## area, then use the items list
            self.items
            if centery < self.items_area.bottom
            ## otherwise use the pool of available items
            else self.available_items
        )

        if collection is self.items:

            ### append the object to the list and sort the
            ### objects in the list according to the 'x'
            ### coordinate of their centers

            collection.append(dragged_obj)
            collection.sort(key=lambda item: item.rect.centerx)

            ### now align the objects in the list relative
            ### to one another based on the position of
            ### the dragged object
            self.reposition_list(collection, dragged_obj)

        ### finally enable the normal mode behaviours
        self.enable_normal_mode()
Perform actions to conclude the dragging action.
nodezator/our3rdlibs/sortingeditor/modes.py