From f2d8e4edb17cdc5a69530ef0af1f9d53f0340adc Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Tue, 3 Nov 2026 17:43:09 -0700 Subject: [PATCH 1/2] Cancel a combo's pending type-ahead when it is destroyed --- api/webapp/extPatches/ext4-patches.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/webapp/extPatches/ext4-patches.js b/api/webapp/extPatches/ext4-patches.js index a81239777c8..a8d1fa87e14 100644 --- a/api/webapp/extPatches/ext4-patches.js +++ b/api/webapp/extPatches/ext4-patches.js @@ -446,6 +446,17 @@ Ext4.override(Ext4.data.Store, { } }); +/** + * typeAhead schedules onTypeAhead 250ms after a query, but onDestroy unbinds the store without cancelling it, so it throws. + */ +Ext4.override(Ext4.form.field.ComboBox, { + onDestroy: function() { + if (this.typeAheadTask) + this.typeAheadTask.cancel(); + this.callParent(arguments); + } +}); + /** * RowExpander plugin is not properly configured to handle sandboxed ExtJS. */ From 8a8e8842eb60d7c4242e81b95b3830d1725deacf Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Tue, 3 Nov 2026 18:06:35 -0700 Subject: [PATCH 2/2] Ignore delayed ComboBox queries and load callbacks after destroy --- api/webapp/extPatches/ext4-patches.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/api/webapp/extPatches/ext4-patches.js b/api/webapp/extPatches/ext4-patches.js index a8d1fa87e14..65d74603c89 100644 --- a/api/webapp/extPatches/ext4-patches.js +++ b/api/webapp/extPatches/ext4-patches.js @@ -447,13 +447,20 @@ Ext4.override(Ext4.data.Store, { }); /** - * typeAhead schedules onTypeAhead 250ms after a query, but onDestroy unbinds the store without cancelling it, so it throws. + * Delayed query/type-ahead tasks and remote load callbacks can fire after onDestroy has nulled the store. Avoid throwing by checking if destroyed. */ Ext4.override(Ext4.form.field.ComboBox, { - onDestroy: function() { - if (this.typeAheadTask) - this.typeAheadTask.cancel(); - this.callParent(arguments); + doRawQuery: function() { + if (!this.isDestroyed) + this.callParent(arguments); + }, + onTypeAhead: function() { + if (!this.isDestroyed) + this.callParent(arguments); + }, + afterQuery: function() { + if (!this.isDestroyed) + this.callParent(arguments); } });