Fix for Issue #1159

Solution based on what is done on the Sortable class.