core icon indicating copy to clipboard operation
core copied to clipboard

wicketstuff-input-events - accumulating event listeners on AJAX components

Open reckart opened this issue 2 years ago • 1 comments

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.

reckart avatar Sep 13 '21 19:09 reckart

Pull Requests are welcome!

martin-g avatar Sep 14 '21 06:09 martin-g