Fixes the open twistys closing when an element is deleted.