MDL-62756 form: Remove any click handler first.
authorMirko Otto <dropsy@gmail.com>
Wed, 12 Dec 2018 09:12:49 +0000 (10:12 +0100)
committerMirko Otto <dropsy@gmail.com>
Fri, 14 Dec 2018 09:26:58 +0000 (10:26 +0100)
The handler has the old state variable. Remove any click handler first.

lib/amd/build/form-autocomplete.min.js
lib/amd/src/form-autocomplete.js

index 0369c31..e66e5ff 100644 (file)
Binary files a/lib/amd/build/form-autocomplete.min.js and b/lib/amd/build/form-autocomplete.min.js differ
index 58a7fc2..c63e561 100644 (file)
@@ -683,6 +683,8 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
         }
 
         var suggestionsElement = $(document.getElementById(state.suggestionsId));
+        // Remove any click handler first.
+        suggestionsElement.parent().prop("onclick", null).off("click");
         suggestionsElement.parent().on('click', '[role=option]', function(e) {
             var pendingKey = 'form-autocomplete-parent';
             M.util.js_pending(pendingKey);