Steps to reproduce:
- Start editing a page using VE. Make some change.
- Hit 'Edit source' tab to switch to wikitext edit mode. Select 'Keep changes' in the prompt.
- Edit something in wikitext.
- Switch to VE by clicking the 'Edit' tab. Select 'Keep changes' in the prompt. Make some changes in VE.
- Try to switch to wikitext mode by clicking on the 'Edit source' tab.
Expected outcome: Same as in 2).
Actual outcome: 'Are you sure you want to leave this page' warning box is shown, and the switch to wikitext is denied.