From 449a8fcbb48c0c947c0edf7264e15940f30b7f4f Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 18 Apr 2025 16:51:03 +0300 Subject: [PATCH] fix multi-enum bc --- client/src/ui/multi-select.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/ui/multi-select.js b/client/src/ui/multi-select.js index 0bb6475ca3..9449407e61 100644 --- a/client/src/ui/multi-select.js +++ b/client/src/ui/multi-select.js @@ -204,10 +204,14 @@ const MultiSelect = { $el.selectize(selectizeOptions); - $el[0].selectize.on('item_before_remove', (v, $item) => { - // Otherwise, the item is left active. - $item.removeClass('active'); - }); + if ($el[0]) { + // Check for compatibility with existing code where initialing is called against non-existing element. + + $el[0].selectize.on('item_before_remove', (v, $item) => { + // Otherwise, the item is left active. + $item.removeClass('active'); + }); + } }, /**