You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.
After a little bit of testing i found out that jQuery change handler (handler for native javascript event of type "change") is added to underlying select element every time method SelectBase.onLoad is called. However this handler is not removed during call to SelectBase.onUnload (which itself calls private method SelectBase.unbindSelectEvents). This leads to undesired behavior that one user interaction fires ChangeEvent many times (as many as SelectBase.onUnload was called).
To fix this issue my advice is to add this one line to method org.gwtbootstrap3.extras.select.client.ui.SelectBase.unbindSelectEvents. This line would be: $wnd.jQuery(e).off("change"); (or we can use constant instead of string literal "change").
I am also providing example source code documenting described issue. Run it with browser's console opened and see the logs. Then wait few seconds to let timers complete. After that click on the Select widget and you can clearly see that ValueChangeHandler is called twice.
Also in the browser' console window we can see that event handler for "change" event is still here even if SelectBase.onUnload was called.
After a little bit of testing i found out that jQuery change handler (handler for native javascript event of type "change") is added to underlying select element every time method
SelectBase.onLoad
is called. However this handler is not removed during call toSelectBase.onUnload
(which itself calls private methodSelectBase.unbindSelectEvents
). This leads to undesired behavior that one user interaction firesChangeEvent
many times (as many asSelectBase.onUnload
was called).To fix this issue my advice is to add this one line to method
org.gwtbootstrap3.extras.select.client.ui.SelectBase.unbindSelectEvents
. This line would be:$wnd.jQuery(e).off("change");
(or we can use constant instead of string literal "change").I am also providing example source code documenting described issue. Run it with browser's console opened and see the logs. Then wait few seconds to let timers complete. After that click on the Select widget and you can clearly see that
ValueChangeHandler
is called twice.Also in the browser' console window we can see that event handler for "change" event is still here even if
SelectBase.onUnload
was called.Here is example source code:
EntryPoint class
GWT module
index.html
Maven dependencies
The text was updated successfully, but these errors were encountered: