Notification function called immediately before an element is closed.
The default implementation of this function does nothing. This function can be overridden in custom classes.