Resolve issue with e.target.tagName throwing errors in the editor