Fix onbeforeunload warning becomes null after leaving EditorScreen