In https://github.com/nucleic/enaml/pull/303, a proper mechanism to handle attempt to close a DockItem has been added. Once enaml get a new release we should start using it.