addCloseHandler(new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
- if (shadow.getParentElement() != null) {
- shadow.getParentElement().removeChild(shadow);
- }
+ removeShadowIfPresent();
}
});
}
adjustZIndex();
}
+ private void removeShadowIfPresent() {
+ if (shadow != null && shadow.getParentElement() != null) {
+ shadow.getParentElement().removeChild(shadow);
+ }
+
+ }
+
private void adjustZIndex() {
setZIndex(Z_INDEX);
}
Util.runIE7ZeroSizedBodyFix();
}
+ @Override
+ protected void onDetach() {
+ super.onDetach();
+
+ // Always ensure shadow is removed when the overlay is removed.
+ removeShadowIfPresent();
+ }
+
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);