Remove opened datepicker cause error

When an auther component have removed an opened datepicker, we got error 'off undefined' because $element no more existe.

This error can appears in a ngGrid custom template.