fix #23030 : Missing action buttons in TextEditor

Is now able to cancel editing. And closing TextEditor
with X clears any modifications, which is most intuitive.