core
core copied to clipboard
wicketstuff-input-events - accumulating event listeners on AJAX components
When adding an InputBehavior
to a component which is updated via AJAX, it can happen that the event listener registered by the InputBehavior
is registered over and over again during AJAX updates. This is a resource leak and also can lead to input events being triggered way too often.
I believe a reasonable fix for this behavior would be to update the JS which registers the listener to remove any existing listener for the key binding for which the new listener is created. This is may be as simple as adding a shortcut.remove(keys)
before the shortcut.add(keys,...)` call in the template.
Pull Requests are welcome!