Suggest to add the event handler in `onBeforeShow` and remove it in `onBeforeHide` as we don't want the elements get updates when the panel is not in the viewport.