Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
TinyMCE: fix IE11 lost focus after init #12206
I'm not sure what is causing the focus loss. An easy fix is to just set it back if focus is gone.
How has this been tested?
Types of changes
Unfortunately we now have failing e2e test, which is was expecting a bit. The reason for this is that the user might already have move the focus in the meantime, and we'd still be setting back focus.
I'm slightly tempted to just not initialise TinyMCE in IE11.
For some reason focus moves to:
<div tabindex="0" class="wp-block editor-block-list__block is-typing" id="block-d7cdbeb7-cdab-4e94-8539-1fa71d1463f1" aria-label="Block: Paragraph" data-type="core/paragraph">...</div>
So the tab-able element seems to capture focus?
No, it does receive focus. This PR checks for it, to then set it back. If you don't init TinyMCE at all, everything works. Something happens during TinyMCE init that moves away the focus to the block.