Breaking Change T934234
Visible to All Users

Sortable - The layout is no longer automatically updated on dragging an item

What Changed

Prior to v20.2, the Sortable component obtained the dimensions of its items whenever an item was being dragged. In v20.2 and later, the dimensions are obtained when a user starts to drag an item and when they move it to another Sortable.

Reasons for Change

The new behavior increases performance in older browsers and with large numbers of Sortable items.

Impact on Existing Apps

This change affects only those applications that allow Sortable items to be updated during dragging (for example, if you use live updates or load new items on scrolling).

How to Update Existing Apps

Since the Sortable layout is no longer updated automatically, you need to update it manually. Call the Sortable's update() method after items are added or their dimensions are changed.

Depending on the framework, call the update() method in different places:

  • jQuery - immediately after a markup update;
  • React - in the useEffect hook or in the componentDidUpdate lifecycle method;
  • Angular - in the ngAfterViewChecked hook;
  • Vue - in the $nextTick lifecycle method.

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.