MDL-62756 form: Remove any click handler first.

The handler has the old state variable. Remove any click handler first.
This commit is contained in:
Mirko Otto
2018-12-14 10:22:11 +01:00
parent c8b4ee45a4
commit f32c2f7c47
2 changed files with 3 additions and 1 deletions
File diff suppressed because one or more lines are too long
+2
View 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);