An update on behaviour with the basic editor, in case it helps with the continuing debugging work:
If I open a page that contains a text entry box, I can now close it again without the warning message coming up, so long as I don't do anything else on the page.
If I try to leave the page by (left-)clicking on a link, the warning message still appears.
If I right-click a link on the page and then ESC out of the context menu, the warning message also still appears.
And if I left-click anywhere on the page that doesn't respond to left-clicking alone (eg a single left-click in the middle of text), the warning message also still appears.