Project

General

Profile

Defect #44372 ยป 0001-Work-around-jQuery-UI-sortable-performance-regressio.patch

Go MAEDA, 2026-08-25 05:32

View differences:

app/assets/javascripts/application-legacy.js
990 990
  $(input).datepickerFallback("option", "defaultDate", default_date);
991 991
}
992
// Workaround for a performance regression in jQuery UI 1.12+ that makes
993
// sortable initialization quadratic in the number of items, freezing
994
// Chromium-based browsers on long lists such as custom field enumerations
995
// (https://github.com/jquery/jquery-ui/issues/2062).
996
// Applies the handle class directly, bypassing the widget class tracking.
997
if ($.ui && $.ui.sortable) {
998
  $.ui.sortable.prototype._setHandleClassName = function() {
999
    this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");
1000
    $.each(this.items, function() {
1001
      var handle = this.instance.options.handle;
1002
      (handle ? this.item.find(handle) : this.item).addClass("ui-sortable-handle");
1003
    });
1004
  };
1005
}
1006

  
992 1007
(function($){
993 1008
  $.fn.positionedItems = function(sortableOptions, options){
994 1009
    var settings = $.extend({
    (1-1/1)