Steps to replicate the issue (include links if applicable):
- Go to https://en.wikipedia.beta.wmcloud.org/wiki/Module:Message_box/ambox.css?action=edit&cm6enable=1
- Use one of the WikiEditor keyboard shortcuts, such as ⌃+B to bolden text, or ⌃+K to insert a reference.
What happens?:
The wikitext-specific keyboard shortcuts work.
What should have happened instead?:
They shouldn't work, since we're not editing wikitext.
Other information (browser name/version, screenshots, etc.):
The bubbling of events to the native textarea was added in r1129024 as a means to make CodeMirror integration easier. It was mentioned that this could bit us down the road, and here we are :-P
Ideally the fix would be in WikiEditor (2010). It should probably have knowledge of non-wikitext and react accordingly. Both CodeMirror and CodeEditor use CSS hacks to hide the irrelevant buttons from the toolbar. Related: T47850.
I was not able to figure out why this bug is not present in CodeEditor. I suspect Ace doesn't bubble any keystrokes.
That said, disabling the CodeMirror-to-textarea event bubbling for non-wikitext is probably the safest thing to do, but one of the goals is for all modes/content models is to be treated the same, and this would deviate from that. Maybe that's OK, as there aren't many integrations with non-wikitext to begin with.