I took out the isVisible() check here because the listener is always detached when the results panel is hidden anyway.