diff --git a/sortedm2m/static/sortedm2m/widget.js b/sortedm2m/static/sortedm2m/widget.js
index <HASH>..<HASH> 100644
--- a/sortedm2m/static/sortedm2m/widget.js
+++ b/sortedm2m/static/sortedm2m/widget.js
@@ -108,6 +108,13 @@ if (typeof jQuery === 'undefined') {
             return text;
         }
 
+        function windowname_to_id(text) {
+            // django32 has removed windowname_to_id function.
+            text = text.replace(/__dot__/g, '.');
+            text = text.replace(/__dash__/g, '-');
+            return text;
+        }
+
         if (window.showAddAnotherPopup) {
             var django_dismissAddAnotherPopup = window[dismissPopupFnName];
             window[dismissPopupFnName] = function (win, newId, newRepr) {
Fixing django<I> pop-up closing issue. (#<I>)

* fix: django<I> has removed `windowname_to_id` function but it is breaking sorted-m2m usage on pop-up.