From 629622f09d2bec655f5f3c632174800a147232f3 Mon Sep 17 00:00:00 2001 From: gkresic Date: Thu, 9 Jul 2020 20:12:37 +0200 Subject: [PATCH] Clear handler references after unregistering Since MaterialAutoComplete.loadHandlers() expect handlers to be null to (re)register them, null-ify them when unregistering or they won't be re-registered (for example, after invoking setup(SuggestOracle). --- .../addins/client/autocomplete/MaterialAutoComplete.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java b/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java index 68373a80a..e22cf957e 100644 --- a/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java +++ b/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java @@ -308,8 +308,11 @@ protected void onUnload() { protected void unloadHandlers() { removeHandler(itemBoxBlurHandler); + itemBoxBlurHandler = null; removeHandler(itemBoxKeyDownHandler); + itemBoxKeyDownHandler = null; removeHandler(itemBoxClickHandler); + itemBoxClickHandler = null; } /** @@ -319,6 +322,7 @@ protected void setup(SuggestOracle suggestions) { if (itemBoxKeyDownHandler != null) { itemBoxKeyDownHandler.removeHandler(); + itemBoxKeyDownHandler = null; } list.setStyleName(AddinsCssName.MULTIVALUESUGGESTBOX_LIST);