If "Edit as HTML" is invoked on a closing tag element, clicking inside the editor will commit and close it.
Created attachment 195581 [details] Patch
I've tried to reproduce this bug on minibrowser and Chromium and it worked fine for me. Could you describe what environment do you use? Was anybody be able to reproduce this bug?
It is a bug for the old inspector UI