fix closing issue when pointer-events for CodeMirror are exposed